I have a 2 column layout, which structured something like this:
html structure:
#container
#content
#side-a
.janitor
css:
#container{ width: 501px; }
#content {
float: left;
width: 300px;
border-right: 1px solid black;
}
#side-a{
float: right;
width: 200px;
}
.janitor {clear: both; }
When there is no border everything is fine, but when I add it, layout collapses on zooming out.
That’s because the border width is added to the content width you specified.
#contentis 300px,#side-ais 200px – that’s 500px altogether.#containeris 501px. Without border’s, you’ve 1px still left, BUT…Adding a border, even 1px, makes
#content300px + 2px wide,#side-a200px + 2px wide. I’m surprised it doesn’t collapse when zoomed in.You can fix this by using:
(with appropriate vendor prefixes).