min-height for IE (and all other browsers)
posted on 2009-09-11 16:31:46+08:00 by 7895734
http://www.cssplay.co.uk/boxes/minheight.html
Since min-height doesn't work in IE, this code makes up for IE's shortcomings. The first part of the code is the correct code that works in Firefox and Safari. The second part of the code is for IE. Internet Explorer will ignore min-height and is just given a height of 8em. The IE bug automatically expands the container to fit the extra text.
Since min-height doesn't work in IE, this code makes up for IE's shortcomings. The first part of the code is the correct code that works in Firefox and Safari. The second part of the code is for IE. Internet Explorer will ignore min-height and is just given a height of 8em. The IE bug automatically expands the container to fit the extra text.
/* for browsers that don't suck */ .container { min-height:8em; height:auto !important; } /* for Internet Explorer */ /*\*/ * html .container { height: 8em; } /**/


Comments
This tutorial will tell you how to give min-height, which will work in all the browsers including ie6