Two-column layout with fixed width and height
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.- Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<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 */
div#navigation {
float: left;
width: 200px;
height: 500px;
color: #ffffff;
background-color: #666666;
border: 1px solid #000000;
padding: 5px;
}
* html div#navigation {
width: 212px;
}
div#content {
margin-left: 213px;
width: 600px;
height: 500px;
background-color: #ffffff;
border: 1px solid #000000;
padding: 5px;
}
a {
display: block;
}
a:link,a:visited {
color: #ffffff;
}
</style>
</head>
<body>
<div id="navigation">
<a href="#">Navigation item 1</a>
<a href="#">Navigation item 2</a>
<a href="#">Navigation item 3</a>
<a href="#">Navigation item 4</a>
</div>
<div id="content"><h1>Headline</h1><p>Article goes here</p></div>
</body>
</html>
Related examples in the same category