Use div to create a table layout
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<style type='text/css'>
div#container {
border: thick dotted black;
margin: 0 20px;
background: red;
}
div#float {
text-align: center;
float: left;
border: 1px solid black;
width: 150px;
height: 150px;
}
div.content {
background: lightyellow;
border: 1px solid black;
}
div#clear {
border: 1px solid black;
background: lightgreen;
clear: both;
}
</style>
</head>
<body>
<div id='container'>
<div id='float'>
Float text.
</div>
Content text.
<div class='content'>
Content text.
</div>
Content text.
<div class='content'>
Content text.
</div>
Content text.
<div class='content'>
Content text.
</div>
Content text.
<div id='clear'>
Clear text.
</div>
<div>
Another div.
</div>
</div>
</body>
</html>
Related examples in the same category