Does every DIV have a relative position?

Asked

Viewed 138 times

5

I heard from a development professional that:

"All div is relative even without you define position:relative"

That is correct?

3 answers

11

Wrong, in HTML a position by default (by default) is position: static;

Reference: W3C

  • as well as by default?

  • @When Kazzkiq does not define the position, the value assumed by browser is static to a div.

  • 7

    A yes, the value pattern. It is that the word "defect" is not widely used in Brazil to translate "default". I did not know that "defect" can also be used with the same meaning in Portuguese, interesting. :)

  • 2

    @Jorgeb. would suggest editing for at least "default/default" or "default" instead, so comments could be deleted. I think it’s nice not to interfere in the cultural issue, but unfortunately, this word has a very different meaning in Brazil. (then I delete this comment here too)

3

The standard position is static for any HTML element, if not explicitly specified

position: static;

Jsfiddle

2


No, because when you apply:

div{
    top:100px;
    left:200px;
}

to div does not appear to change, whereas in:

div{
    position:relative;
    top:100px;
    left:200px;
}

is noticeable.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.