But it seems like the Contents div is stretching to 100% of the entire page instead of 100% of the Header Div which is containing it, how do I fix that?
Is this what your after?
(copy and save it in an .html file)
<html>
<head>
<style type="text/css">
<!--
#header{
background :orange;
width :100%;
}
#image{
background :green;
float :left;
width :300px;
}
#contents{
float :left;
width :auto;
background :blue;
text-align :left;
}
-->
</style>
</head>
<body>
<div id="header">
<div id="image">
<img here>
</div>
<div id="contents">
<h1>Contents</h1>
<h3>Look Below blah blah</h3>
<p>Sed tristique posuere dolor. Donec libero augue, aliquam vel, malesuada ut, ornare at, pede. Nullam eget mauris. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut sit amet sem non purus iaculis egestas. Proin ut ipsum non augue congue congue. Maecenas ut lorem ut massa tincidunt tincidunt. Sed dapibus ultricies nisl. Donec quam nisl, faucibus non, dictum molestie, sodales et, justo. Fusce convallis nulla sit amet felis. Duis ipsum. Fusce ac dui quis nulla suscipit semper. Mauris quam. Cras dignissim pharetra sem. Quisque ligula. Praesent posuere. Donec ac dui ullamcorper mauris accumsan tristique. Nunc convallis, libero at euismod faucibus, velit magna iaculis sem, at placerat est leo nec pede. Morbi aliquam odio rutrum neque. Curabitur suscipit condimentum pede. </p>
<p>Sed et massa in enim molestie aliquam. Vestibulum vel tortor ut eros rhoncus fringilla. Nulla eu tellus. Donec varius. Aliquam erat volutpat. Maecenas quis libero. Ut pharetra aliquet velit. Curabitur et diam. Fusce fringilla, sapien ut convallis gravida, magna nulla interdum purus, ac porta ipsum mi ut lacus. Mauris tincidunt, ante eget gravida lacinia, quam eros lobortis massa, eget pulvinar mi lacus in nulla. Praesent commodo turpis ut purus. Fusce lacinia quam ut dui. Mauris id ligula. Ut est lorem, lacinia at, luctus sit amet, feugiat eu, libero. Aenean elementum neque ornare nisl. Etiam hendrerit molestie lorem. Duis vitae augue sed elit porta aliquet. Nulla semper porta erat. </p>
</div>
</div>
</body>
</html>
I put a few dummy paragraphs in so I could see if the text stayed to the right of the image and added some colour via css so I could see if it definatly worked.
You have header as 100% of the window and as such 100% of the header will also be 100%. You need to lower the width of the header if you want what you want haha.
The trick here is to NOT float the #contents div. A 100% width will be 100% of the parent (full width). Floating without a set width will not work either, as when content pushes the width, the float will drop below the left float to find more room. If #contents has its overflow set and no width specified, it will naturally fill the remaining space beside the image. IE6 will need HasLayout triggered to perform the same way :
That will fail as soon as the contents of #contents wants more than the available width, whereupon #contents will drop below the image - the example L4DD13 gave above fails in this respect.
If you have used that in multiple sites you may want to consider going back and using a more appropriate method. If you have dynamic content in there you are basically asking to have your layout broken.