HTML
<div class="row">
<div class="column"></div><div class="column"></div>
<div class="column"></div>
</div>
.column {
float: left;
width: 33.33%;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
float: left;
width: 33.33%;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
EXAMPLE CSS FOR UNEQUAL COLUMN
.column {
float: left;
}
.left, .right {
width: 25%;
}
.middle {
width: 50%;
}
float: left;
}
.left, .right {
width: 25%;
}
.middle {
width: 50%;
}
Responsive three column layout: CSS
/* Responsive layout - when the screen is less than 600px wide, make the three columns stack on top of each other instead of next to each other */
@media screen and (max-width: 600px) {
.column {
width: 100%;
}
}
@media screen and (max-width: 600px) {
.column {
width: 100%;
}
}
Comments
Post a Comment