Jump to content

[SOLVED] How to clear absolute


ifubad

Recommended Posts

Is there a way to clear an absolute element using css?

 

No. Elements positioned as absolute go out of the flow of the content. It doesn't matter what's on the page, they simply glue right on top. Therefore, why would there be a clear? Clear only works for statically/relatively positioned divs that go with the flow of the document.  ;)

Link to comment
Share on other sites

 

Clear only works for statically/relatively positioned divs that go with the flow of the document

 

I know clear works with float, but isn't that also being removed from the flow of the document, hence the container collapsing since nothing is considered to be there anymore?

Link to comment
Share on other sites

maybe I'm just not understanding the way God explained it

 

only works for statically/relatively positioned divs that go with the flow of the document

 

Since a float is also not considered a part of the flow anymore, but clear works with it, while absolute is also not part of the flow, and clear does not not work with it. Oh well, guess that's just the way it is and I'll have work around that issue.

Link to comment
Share on other sites

As far as I understand it, floats are taken out of the flow of the document in the place they are - they don't get moved to another location. They remain in the same place, they are just not affected by the flow. Absolutely positioned elements are taken out of the flow of the document entirely.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.