return to I Love My Journal
A Little Closer to Center...
Musings about Life, Linux, and Latter-day Saints.
Pages
About Me
Links


Tags
PERSONAL 520
SPIRITUAL 416
LDS 312
BOOK OF MORMON 237
SCRIPTURES 154
STUDIO-JOURNEY 129
RELIGION 112
LINUX 79
COMPUTERS 65
LIFE 60
GENERAL CONFERENCE 46
GENTOO 39
MISCELLANEOUS 37
MUSIC 37
PROGRAMMING 33
CARS 29
MICROSOFT 23
FAMILY 23
AUDIO 21
I LOVE MY JOURNAL 18
FUN 15
CHILDREN 12
CURRENT EVENTS 10
NATURE'S WAY 10
VIDEO 9
DRM 9
CONEXM 7
BABBLINGS 7
PROVO CITY CENTER TEMPLE 6
FRIENDS 6
HEROD THE FINK 5
GAMES 5
COMPUTER HARDWARE 5
DRUMS 4
HAND OF GOD 3
ADVERSITY 3
KDENLIVE 3
AUDIO HARDWARE 3
GENERAL INSANITY 3
STUDIO 3
THANKS4GIVING 2
CATS 2
MY JOURNAL 1
POETRY 1
FOREVERGREEN 1
EVERYDAY THOUGHTS 1
GOSPEL 1
PARENTING 1
YOUTH CONFERENCE 1
CHURCH NOTES 1
POLITICS 1


RSS Feed

RSS FeedSubscribe!
Tue - Oct 12, 2010 : 02:50 pm
frustrated
   rated 4 times
>>next>>
<<previous<<
IE min-height solution
Why does Microsoft insist on making life so hard for developers?

There are web standards, Microsoft, in case you missed the memo.  Please adhere to them.  It would do EVERYONE good.

Here's yet another hack to get IE to work in cases where min-height is used (according to my browsers, this still doesn't work in even IE8)

I found this solution here, but will re-post because redundancy for solving IE crap through hacks is a very good thing...  That is, until they pull their head out and realize that FIXING THE PROBLEM would be the very best solution.     ...who am I kidding.  That'll never happen.

Anyway.. Here's the hack.


If you use an underscore in front of normal CSS properties, IE will process them, but other browsers will not. In practice, this allows you to specify “alternate IE settings” for virtually any CSS property. This is known as the Underscore Hack.

So, to set a minimum height, first use the actual property:

min-height: 300px

then use the underscore hack to set the height property.

_height: 300px

All browsers but IE will ignore the hacked property, and since IE effectively treats height as min-height, you’ll get the effect that you want in all browsers.


There ya go.  Easy-schmeasy.
Comment by Alex on Oct. 13, 2010 @ 02:34 am
min-height: 300px; /* for those who understand it */ height: auto !important; /*again */ height: 300px; /* IE doesn't respect !important within single rule, though, most other browsers do */
Comment by tom on Nov. 19, 2010 @ 01:36 pm
Instead of the _hack you can also use conditional comments (<!--[if IE]> ...height: 300px;... <![endif]-->)
Comment by joel on Nov. 04, 2011 @ 09:17 am
This worked for me:

{
   min-height:auto; /*most smart browesrs*/
    *height:790px; /*ie7*/
    _height:790px; /*ie6*/
}
Comment by oinofilo on Apr. 30, 2012 @ 12:02 pm
The _height trick works great. BTW IE9 still doesn't understand min-height: stupid MS!
Comment by anonymous on Jul. 11, 2012 @ 11:16 am
Awesome, thank you!
Comment by Joshua Bowman on Mar. 05, 2013 @ 01:00 am
Uh, guys, instead of complaining about IE not fixing something they fixed way back in IE7 maybe you should just change your pages so that IE6 quirks mode isn't getting enabled.

Just add the following to your head tag:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

And poof, instant standards mode in IE.