August 23, 200917 yr Hi guys i'm having problem with my MAIN DIV not expanding to accommodate the to inner DIV (fleft and fright) which have a float Left and Float Right to give me a 2 Column Layout: Here is the HTML <div id="Main"> <div id="fleft"> </div> <div id="fright"> </div> <div style="clear:both"></div> </div> and here is the CSS #Main { background-image:url(Images/page_back.png); background-repeat:repeat-y; max-width:851px; height:400px; padding:20px; } #fleft { float:left; min-width:580px; max-width:580px; height:auto; padding-right:20px; } #fright { float:right; min-width:165px; max-width:165px; height:340px; padding-top:70px; padding-left:20px; padding-right:20px; background-image:url(Images/info.png); background-repeat:no-repeat; } as you can see i have already tried clearing the floats but that didn't make any difference, any ideas cheers, tommyflint
August 23, 200917 yr That's really weird this is the third time today this issue has been raised, this should fix it: http://www.webdesignerforum.co.uk/topic/25473-tip-of-the-day-clearing-floats-with-the-after-selector/page__p__170466__hl__clearfix__fromsearch__1entry170466
August 24, 200917 yr Author cheers for the link scaz192 but unfortunately it didn't fix my issue I will show my new HTML and CSS just incase it didn't work just beacuase i have done it wrong HTML <div id="Main"> <div id="fleft"> </div> <div id="fright" class="clearfix"> </div> </div> CSS #Main { background-image:url(Images/page_back.png); background-repeat:repeat-y; max-width:851px; height:400px; padding:20px; } #fleft { float:left; min-width:580px; max-width:580px; height:auto; padding-right:20px; } #fright { float:right; min-width:165px; max-width:165px; height:340px; padding-top:70px; padding-left:20px; padding-right:20px; background-image:url(Images/info.png); background-repeat:no-repeat; } .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } cheers for looking guys
August 24, 200917 yr Ah yeah you want the clearfix class on the containing div not the column divs, then you should be set.
Create an account or sign in to comment