Cross-browser min-height

No IE, please

The min-height declaration is poorly understood by Internet Explorer. However, here’s a trick to force minimum height on a block element that works in all browsers:

height:auto !important;
height:200px;
min-height:200px;

This would set a min-height of 200px on all browsers. All browsers except IE6 will respect the !important flag and ignore the second height property, while IE6 will still use the second height property, then expand as needed.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">