I'm currently struggling to achieve a proper 3 column layout with my HTML and CSS code. Here's what I have:
<div class="row">
<div class="col">C1</div>
<div class="col">C2</div>
<div class="col">C3</div>
</div>
Here is the CSS:
.row {
width: 964px;
}
.row:last-child {
margin: 0;
}
.row .col {
width: 33.33%
float: left;
margin-bottom: 20px;
margin-right: 10px;
}
The columns are supposed to be equal in width at 33.33%, but there seems to be a gap on the right margin of the last column. Increasing the margin only pushes the column down to the next line.
Is there a way to make sure that all columns have the same width, without any margins on the first and last columns (meaning no left margin for the first column and no right margin for the third column)? Any suggestions would be appreciated!
Thanks in advance.