Tuesday, September 26, 2006

XHTML: Fighting to set height of a left float equaling to a right content float element

Earlier we use “min-height” to fix this, but “min-height” does not work in MSIE and to fix it to work for all browsers, following is the code:

<style type="text/css">
.newElement {float:right; width:1px;}
.clear {clear:both; height:1px; overflow:hidden;}
.minHeightFixer {height:300px;} /*specify the required minimum height here*/
</style>

<div> <!-- content container -->
<div class="newElement minHeightFixer"></div> <!-- div which handles the height -->
page content goes here
<div class="clear"></div> <!-- clearing div -->
</div>

No comments:

Post a Comment