There were some serious issues with your markup, the body
tag should wrap all of the page elements, the basic markup should follow:
<!DOCTYPE html>
<html>
<head>
<!-- meta tags etc -->
</head>
<body>
<!-- page content -->
</body>
</html>
As for the style issue, the #content
div just needs floated to the left as well. There are other ways, but this will probably suffice.
<!DOCTYPE html>
<html>
<head>
<title>Todo list</title>
<style type="text/css">
nav {
float: left;
padding-right: 5px;
margin-right: 5px;
background: yellow;
height: auto; /* auto | inherit | 100% */
width: auto;
}
#content {
margin: 5px;
padding-left: 5px;
float: left;
}
header {
background: blue;
}
footer {
clear: both;
background: #ccc;
}
</style>
</head>
<body>
<header>
Head
</header>
<nav id="main_nav">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/contact">Contact (p)</a></li>
<li><a href="/temp">Temp</a></li>
</ul>
</nav>
<div id="content">
<h1>Test</h1>
<h2>A</h2><h2>C</h2><h2>D</h2>
</div>
<footer>
<p>[Copyright bumf]</p>
</footer>
</body>
</html>