What is the default value of "position" attribute of a DIV?
HtmlCssHtml Problem Overview
I was just wondering what could be the default "position" attribute of a DIV ? Just the way a DIV has display property as BLOCK, what is the default property for position attribute ?
Html Solutions
Solution 1 - Html
position: static;
The default position is static for any html element if not specified explicitly.
Solution 2 - Html
static
is always the initial value for the CSS property position
no matter which tag.
References:
Solution 3 - Html
Unless it was inherited from some of its parents the default is static
Solution 4 - Html
Its Static. The proof of its static positioning.
The HTML:
<div class="position"> <div>
<div style="height:100px;"> </div>
<div class="noposition"> <div>
The 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;
}
It shows that Two divs with separate classes, one without any positioning and one with a static position, positions both the Div's as static.