WordPress.org

Ready to get started?Download WordPress

Forums

Absolute positioning not respecting its parent's containing block (4 posts)

  1. Gabe462
    Member
    Posted 5 years ago #

    I'm trying to keep an H1 element positioned absolutely within its parent element, but it's acting like it thinks its parent is <body>.

    Here's a link, what's up with the "latest news"? change the window width to see.

    http://686.circuittree.net/test/index1.html

    G462

  2. stvwlf
    Member
    Posted 5 years ago #

    Hi

    You have to assign position:relative to the parent element. Then it will behave as you want.

    When there is no position relative assignment in any of its containing blocks, the page element sets its absolute positioning relative to the body tag.

  3. Gabe462
    Member
    Posted 5 years ago #

    Ah, that was simple. Thanks very much for your help!

  4. jlovel
    Member
    Posted 4 years ago #

    I also was having the same problem, and found this thread very helpful. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic