日期:2014-05-17  浏览次数:20495 次

怎么用层来给网页定位???
指定层的位置?(坐标?)来定位?

------解决方案--------------------
float or position
------解决方案--------------------
float
position
------解决方案--------------------
最好用float定位﹐推荐你看本書﹐n好﹐
《无懈可击的Web设计》。

------解决方案--------------------
float:left, float:right position:absolute
------解决方案--------------------
将“position”设置为:absolute;再设置“left”和“100”,如下:
HTML code

<div style="position: absolute; width: 100px; height: 100px; z-index: 1; left: 100; top: 100" id="layer1">
 </div>

------解决方案--------------------
HTML code
<body>
<div  style="position:absolute; top:100px; left:100px; border:1px solid #ff0; z-index:10000; height:300px; width:300px;">
<div style="position:relative; top:20px; left:20px; border: 1px solid #0ff; float:left; width:50px; height:50px;"></div>
<div style="position:relative; top:20px; left:20px; border: 1px solid #0ff; float:left; width:50px; height:50px;"></div>
</div>
</body>