我想知道DIV的默认"position“属性是什么?就像DIV将显示属性设置为块一样,位置属性的默认属性是什么?
发布于 2013-05-14 19:09:42
position: static;
如果未显式指定,则任何html元素的默认位置都是静态的。
发布于 2013-05-14 19:21:59
它是静电的。其静态定位的proof。
HTML:
<div class="position"> <div>
<div style="height:100px;"> </div>
<div class="noposition"> <div>
CSS:
div.position
{
width:100px;
height:100px;
background:red;
left:10px;
top:100px;
position:static;
}
div.noposition{
width:100px;
height:100px;
background:blue;
left:10px;
top:100px;
}
它显示了具有单独类的两个Div,一个没有任何定位,另一个具有静态位置,将两个Div都定位为静态。
https://stackoverflow.com/questions/16316834
复制相似问题