What is the default value of "position" attribute of a DIV?

HtmlCss

Html 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">&nbsp;<div>
    <div style="height:100px;">&nbsp;</div>
<div class="noposition">&nbsp;<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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJanakView Question on Stackoverflow
Solution 1 - HtmlMohit SrivastavaView Answer on Stackoverflow
Solution 2 - HtmlSirkoView Answer on Stackoverflow
Solution 3 - HtmlPavelView Answer on Stackoverflow
Solution 4 - HtmlNiteshView Answer on Stackoverflow