Using div with different height to create layout
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>CSS Positioning Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type='text/css'>
/* CSS Document */
body {
background-color:#efefef;
font-family:arial, verdana, sans-serif;}
div {
width:800px;
border:1px solid #000000;
margin:1px;
padding:5px;}
div#masthead {
height:100px;
background-color:#d6d6d6;}
div#navigation {
height:40px;
background-color:#666666;
color:#ffffff;}
div#body {
height:100%;
background-color:#ffffff;}
</style>
</head>
<body>
<div id="masthead"><h1>Masthead</h1></div>
<div id="navigation">
<span class="navItem">Navigation item 1</span> |
<span class="navItem">Navigation item 2</span> |
<span class="navItem">Navigation item 3</span> |
<span class="navItem">Navigation item 4</span>
</div>
<div id="body"><h1>Headline</h1><p>Article goes here</p></div>
</body>
</html>
Related examples in the same category