Keep in mind I'm new to CSS.
I've been trying to solve this for a couple of weeks hunting all over the web for an answer.. I'm trying to convert a table based layout to CSS. (I can make this work exactly as I expect by using a old fashioned table inside the "wrapper" div instead of using the "header", "nav" and "maincontent divs".)
Inside the "wrapper" dive I'm expecting the "maincontent" div to appear on the right side of the "nav" div. It does, but not in a window smaller than 640px, smaller and the "maincontent" div floats down instead of simply getting narrower.
<DOCTYPE HTML>
<html>
<head>
<title>test-page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.wrapper {
float: left;
width: width:100%; max-width:640px;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
text-align: left;
border: 0px solid black;
}
.header {
float: left;
width: width:100%; max-width:640px;
margin: 0px 0px 0px 0px;
padding-left: 0px;
text-align: left;
border: 0px solid black;
}
.nav {
float: left;
width: width:100%; max-width:120px;
margin: 5px 0px 0px 0px;
padding-left: 0px;
text-align: left;
border: 0px solid black;
}
.maincontent {
float: left;
width: width:100%; max-width:480;
margin: 5px 0px 0px 0px;
padding-left: 15px;
text-align: left;
border: 0px solid black;<br>
}
</style>
</head>
<body style="max-width:1024px; bgcolor="#FFFFFF" text="#000000">
<div class="wrapper">
<div class="header">
<img style="height:auto; width:100%; max-width:640px;" src="/headerImage.jpg">
</div>
<div class="nav">
<p>MainNavigation<br>
Nav1<br>
Nav2<br>
Nav3<br>
Nav4<br>
etc </p>
</div>
<div class="maincontent">
A Few Words<br>
<img style="height:auto; width:100%; max-width:470px;" src="/another.jpg" width="468" height="351"><br>
more words
</div>
</div>
</body>
</html>