Layout using mainly Floats - the centre div extends with content but is now hidden underneath the rest of the page
I have a site layout that uses floats to achieve the desired columns/rows.
On the main page, the main content div has a min-height of 200px, which is perfect for the content on that page. However, the pages after the home page require the content in this div to be considerably longer. It works fine in Firefox, but not so much in IE - where the div does extend however it just extends underneath the divs that are beneath it.
Links to screenshots are here:
http://i35.tinypic.com/289zpky.jpg - internet explorer example:
As you can see above, in IE it doesnt work at all. it works fine in firefox however.
<div class="homebox-pages">
<h1>Transaction Details<br />
</h1>
<p>What type of quote would you like?</p>
<select name="Quote-Type">
<option>Sale</option>
<option>Purchase</option>
<option>Hip</option>
<option>Sale and Hip</option>
<option>Sale, Purchase and Hip</option>
</select>
<p>Sale Property Value: £<br />
<input name="Sale Property Value" type="text" value="£" size="30"/></p>
<p>Do you require a HIP?
<input name="Do you require a HIP?" type=开发者_StackOverflow社区"checkbox" value="" /></p>
<p>HIP Property Value: £<br />
<input name="Purchase Property Value" type="text" value="£" size="30"/></p>
<p>Tenure Type:</p>
<strong>Freehold</strong><input name="Tenure Type" type="radio" value="Freehold" checked="checked" />
<strong>Leasehold</strong><input name="Tenure Type" type="radio" value="Leasehold" />
<strong>Unknown</strong><input name="Tenure Type" type="radio" value="Unknown" />
<p>Is the property Registered?</p>
<strong>Registered</strong><input name="Registered" type="radio" value="Registered" checked="checked" />
<strong>Unregistered</strong><input name="Registered" type="radio" value="Unregistered" />
<strong>Unknown</strong><input name="Registered" type="radio" value="Unknown" />
<p>Email Address:*<br />
<input name="E-Mail Address" type="text" size="30" class="txtarea required" /></p>
<p>Mobile Number:<br />
<input name="Mobile Number" type="text" size="30" /></p>
<p>Where did you hear about us?:*<br />
<select name="Where did you hear about us?">
<option value="Google">Google</option>
<option value="Word of Mouth">Word of Mouth</option>
<option value="Previous Customer">Previous Customer</option>
<option value="Yell">Yell</option>
</select>
<br />
<br />
<input name="Submit" type="submit" />
</div>
And the CSS for homebox is:
.homebox-pages
{
background-color:#39C;
background-position:center;
background-repeat:no-repeat;
min-height:200px;
width:70%;
float:left;
overflow:visible;
clear:both;
}
You might try add the clearfix
class to your main block. It is defined here: http://www.webtoolkit.info/css-clearfix.html
It helps make browsers render the entire container, even when its contents are floated.
精彩评论