This is a problem I've had several times when trying to create layouts with a sidebar.
I made an example here: http://samutz.com/div.html
#content has stuff inside it that needs to float and then clear within #content only. But when I try to clear inside #content, it clears the #sidebar's float as well, despite #sidebar being outside of #content.
Option A:
overflow:hidden; zoom:1;
If this messes up #content text, put the text inside this new div:
http://medero.org/clear2.html
Explanation for overflow technique: http://work.arounds.org/clearing-floats/
Option B:
You can also absolutely position the sidebar but you might have to mess with min-heights if it becomes long.
Extra:
If you need to contain the sidebar with your main wrapper:
http://medero.org/clear3.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With