Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Simple Absolute Positioning Question

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #236045
    MMBlast
    Participant

    Why does #div1 position itself using #div0 but #div1 uses the body(?) unless I set #div0 to relative? I’m going bonkers, much thanks to anyone who can clear this up for me!

    http://codepen.io/MMEquinox/pen/XXdvVW

    #236046
    Shikkediel
    Participant

    If you don’t define a top position for the absolute element, it will be placed as if it were positioned statically according to document flow. So it isn’t positioned using #div0 either unless that has relative positioning but just appears that way – after the header.

    #236047
    MMBlast
    Participant

    Completely cleared that up for me, much obliged.

    #236049
    jmeguy
    Participant

    I don’t know what exactly you are trying accomplish, but looking @ your code I modified it.

    http://codepen.io/anon/pen/BjzBmg

    You need to give the outer element position relative and then they will all come inside the #div0.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.