Jump to content
Randomishlying

Absolute child of absolute child of relative parent

Recommended Posts

If an element is relatively positioned, its child is absolutely positioned (within the parent container), and the child has a child which is also absolutely positioned. Why is it that the child's child continues to be absolutely positioned relative to its parent container, when it's parent isn't relatively positioned? It seems to go on an on like this.I'm probably just thinking about this the wrong way, but I find it to be confusing. If someone could explain this to me, I would be greatful.

Share this post


Link to post
Share on other sites

Absolute positioning will be relative to the closest ancestor that has positioning different than "static"

Share this post


Link to post
Share on other sites

I just had a "d'oh!" moment. Thanks for putting up with my ignorance. Thanks to you, my brain has finally made the connection.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...