Set min height for three column layout in HTML and CSS

Description

The following code shows how to set min height for three column layout.

Example


<html>
<head>
<title>Layout Example</title>
<style type='text/css'>
body {<!--from  ww w . j  av  a  2 s.  c  o m-->
margin:0px;
background-color:#ffffff;
font-family:arial, verdana, sans-serif;}

#header {
background-color:#cccccc;
padding:10px;
height:120px;}

#navigation {
background-color:#efefef;
padding:10px;
height:40px;}

#footer {
background-color:#cccccc;
padding:10px;
height:40px;
clear:both;
border-top:20px solid #ffffff;}

.column1of3, .column2of3, .column3of3 {
float:left;
width:28%;
margin-left:2%;
background-color:#cccccc;
padding:1%;
margin-top:20px;
height:175px;
min-width:210px;
max-width:400px;}

#header, #navigation, #footer, .columns123 {min-width:750px;}
</style>

</head>
<body>
<div id="header">header</div>
<div id="navigation">navigation</div>
<div class="columns123">
<div class="column1of3">column 1 of 3</div>
<div class="column2of3">column 2 of 3</div>
<div class="column3of3">column 3 of 3</div>
</div>
<div id="footer">footer</div>
</body>
</html>

Click to view the demo

The code above generates the following result.

Set min height for three column layout in HTML and CSS