我只是想知道DIV的默认“位置”属性是什么?就像DIV将显示属性显示为BLOCK一样,position属性的默认属性是什么?
Answers:
position: static;
如果未明确指定,则任何html元素的默认位置都是静态的。
as part of normal HTML flow
”
其静态。静态定位的证明。
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都定位为静态。
Click On the Element --> Computed --> Filter --> Show All
。希望可以帮助某人。