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.  ;)

 

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?

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.