Hey all, so basically I have a very simple layout with a header image, a main centered text area. And a sidebar that is to the left of the main centered text area. This is basically how my layout looks:
<center>Header</center>
<div style="float:left;">Sidebar</div>
<center>Main Area</center>
Well the sidebar is obviously going to align all the way to the left side of the page, what I would like it to do is still be on the left side of the page, but I want it to "hug" the main centered area.
Here is a basic picture of what it looks like now, and an arrow of what I would like to happen: http://img18.imageshack.us/img18/2307/exampleps.jpg
Live demo: http://jsfiddle.net/rRm7k/
HTML:
<div id="wrap">
<div id="header"> HEADER </div>
<div id="body">
<div id="sidebar"> SIDEBAR </div>
<div id="main"> MAIN CONTENT </div>
</div>
</div>
CSS:
#wrap { width:500px; margin:0 auto; }
#body { overflow:auto; }
#sidebar { float:left; width:150px; min-height:400px; }
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