Min-height in Internet Explorer

Contact me
 
June 07th, 2006 - Filed under CSS Play by Cristian Mezei
5 Votes | Average: 3.4 out of 55 Votes | Average: 3.4 out of 55 Votes | Average: 3.4 out of 55 Votes | Average: 3.4 out of 55 Votes | Average: 3.4 out of 5 (5 votes, average: 3.4 out of 5)
Loading ... Loading ...
| 3,902 Views
 

We all know IE sucks at web standards and CSS interpretation. All the damn browsers out there read CSS ok, but IE noooo. Microsoft has to be different.

They even state in the MSDN Min-height Attribute :

This feature requires Microsoft Internet Explorer 6 or later.

Well no. IE doesn’t support this attribute.

Here is a quick CSS fix to get the min-height property to work in Internet Explorer :

.box {
width: 120px;
border:1px solid #E8D495;
background-color: #FFF2BF;
padding:5px;
margin:5px;
height:auto;
min-height:180px;
}

/* IE fix */

* html .box {
height: 180px;
}

Don’t worry about the fixed height for Internet Explorer, because Microsoft is good at bugs. IE will auto set the height of the used element, to fit the content, even if we gave a fixed one.

Live preview with images, because of the wordpress post limitation, using min-height 180px, in Firefox and Internet Explorer (in that order):

CSS Min-height in Firefox CSS Min-height in Internet Explorer

Other great places to learn more about the min-height, or hacks to make it cross-browser:

Submit your website to Webxperience! and Webotopia directories and get bonus deeplinks.
If you found this post useful please Subscribe with Bloglines Add to Technorati Favorites (new windows)
Tags: none
 

No comments yet. Be the first.


Leave a reply

Allowed tags (XHTML): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

RSS Readers & Technorati:

My Subscribers Add to Technorati Favorites
View Cristian Mezei's profile on LinkedIn

Subscribe & Syndication:

RSS Feed at FeedBurner NewsGator Google Bloglines My MSN Add to My Yahoo! Add to FeedLounge Add to My AOL Add to NetVibes Add to NewsBurst Add to Pluck Add to NewsIsFree

Updates by e-mail:

My Blogroll:

Blogs & Forums (RO)

Blogs & Websites

Official Blogs

Social Websites
Powered by Bloglines

Tag Cosmos: Top Tags