I am attempting my first three-column layout with css. I am new to using css for layout, as I have always used tables in the past. My problem is that when the browser window is shrunk, my right column collapses in overtop of my content area and, if you shrink the window enough, eventually ends up sitting underneath my left column. This happens with both float: right and with using absolute positioning for the right column.
What I really want is for my content area to be able to stretch (as it does now), but when the window is shrunk I want the right-positioned column to stop moving when it hits the right side of the content area. I tried wrapping a div around all three columns with a set width, which keeps the columns from collapsing, but it also keeps the content area from expanding. I also tried setting a left margin on the right column, but that just pushes the content around at the edge of the margin.
This is probably simple, but it is giving me headaches trying to figure it out. Below is my css code with the relevant id's. I removed all of the id's for my content elements to make it less confusing.
body {
margin: 0;
padding: 0;
background-color: black;
color: white;
font: small Arial, Helvetica, Verdana, sans-serif;
}
#content {
width: 625px;
margin: 0px 180px 0px 180px;
background-color: black;
color: white;
}
#left_sidebar {
float: left;
width: 180px
}
#right_sidebar {
float: right;
width: 180px;
}
Please help if you know how to resolve this.



Reply With Quote
Bookmarks