怎样才能在div里插入一个flash然后用css定位?

来源:百度知道 编辑:UC知道 时间:2024/05/13 00:33:14
<div id="flash">
#flash{width:200px;height:100px;}
flash的大小为width="100px" height="50px"
我要使flash在div里水平右对齐 垂直用像素定位,如何能办到?
我用text-align无效,padding定位后在DW里能看到效果,但运行浏览还是在顶部。

你这是一个层,应该在这个DIV的外部再加上一个父层div,用于固定你的这个div。
比如:
<div style="position:relative" id="sss">
<div id="flash" style="position:absolute; z-index:1;left:6px; top:6px;">
……
……
</div>
</div>
这样来固定,注意relative和absolute不要搞反了,用left和top或者right,bottom来定义相对位置。

楼上的那种方法是无法固定住在不同分辩率中的层的,除非处于最边边。

#flash{width:200px;height:100px;}

给flash一个id
比如id="flash1"
#flash1{margin-top:20px;float:right;}