I did my homework on other StockOverflow posts, but couldn't find my answer. Basically I have two pieces of content 1) a project number and 2) a headline. In javascript I'm setting the width of the project number div to be one eighth of the window width (this works fine). Then I'm trying to place my headline to the right of it with a left margin of 15%. It looks fine, except when I reduce my window width- the headline jumps down outside of my projectContainer... The width of my projectContainerHeadline is 100% - and I've tried making this fixed - say 900px - and when i shrink my window it's fine - but when i increase my window size even larger it jumps out again when the headline goes past the 900px mark. I'm thinking there has to be something I'm missing in order to have a fluid width site work w/ these floats...Also overflow: hidden isn't helping the situation...In essence I want to have my headline div floated to the left without it jumping out of it's block/container. I need it floated left so that it's margin-left will dynamically update as the width of the left container changes.
My html code can be found here:
<div class="projectContainer">
<div class="projectContainerHeadline">
<div class="projectNum">01</div>
<div class="projectHeadlineText">
<h2>Test Headline</h2>
<h3>Test sub-headline</h3>
</div>
</div>
</div>
</div>
My css can be found here:
.projectContainer{width: 100%; float: left;}
.projectContainerHeadline{height: 130px; float: left; width: 100%; background-color: pink;}
.projectNum{font-family: Helvetica,Arial,sans-serif; font-size: 105px; text-align: right; border-top: 11px solid #d9a870; min-width: 100px; float: left;}
.projectHeadlineText{float: left; margin-left: 15%;}
.projectHeadlineText h2{background-color: blue; margin: 20px 0px 0px 0px;}
.projectHeadlineText h3{background-color: red; margin: 3px 0px 0px 0px;}