I'm making a site with two columns. Either of the columns can be larger than the other and they have different backgrounds. My problem in trying to do it with CSS with the clearfix trick, is that colors are right when the color of the underlying wrapper has the color of the shorter column, but when it has the color of the larger column, the design changes visually. Maybe I'm doing it wrong.
I've achieved what I want, but with tables. I've asked a friend that makes websites and he told me that tables shouldn't be used for design and that tables are for cavemen. The funny thing is that he couldn't achieve what I want either.
Well, this is basically my HTML code:
<div class="float_container clearfix">
<div class="column1">
Column 1 content
</div>
<div class="column2">
Column 2 content
</div>
</div>
This is my CSS:
.column1 {
float: left;
width: 200px;
background-color:red;
}
.column2 {
float: left;
width: 390px;
height: 1%;
background-color:blue;
}