Min height cross browser CSS

In CSS version 2 there is a “min-height” property, but it doesn’t work in the same way in every browser,…

December 17, 2009

In CSS version 2 there is a “min-height” property, but it doesn’t work in the same way in every browser, or better, it’s not supported by every browser.

Looking around in the web I’ve found different CSS tricks to make min-height properties cross browser.
Here they are, I usually use the third one, but I do not know if it is the best one:

FIRST METHOD

/* for browsers that don't suck */
#container { min-height:200px; height:auto !important; }

/* for Internet Explorer */
/*\*/
* html #container { height: 200px; }
/**/

SECOND METHOD

#container  { min-height:200px; }
* html #container { height:200px; }

THIRD METHOD

#container {
   height:auto !important;
   height:200px;
   min-height:200px;
}

Author

I’m a software engineer, an everyday web developer and a maker. I usually build sites with PHP, within or without WordPress. I build Internet of Things with Arduino and ESP8266. I’m the founder of Rockit.it and Dailybest.it and I’m actually the Chief Technical Officer of Better Days web agency.


Recommended

Cross browser opacity

Is there a css definititon to make cross browser opacity? Yes. I found this, and it seems to work: If…

November 12, 2009

A new avatar generator for WordPress with get_avatar and Flathash

Brand new avatars for WordPress Gravatar service

April 7, 2017

3 ways to add author’s image in WordPress

Add author's image in WordPress without a plugin

April 5, 2017

Orari trenord, corri solo quando ce n’รจ bisogno

Hai presente quando corri in stazione per prendere il treno al volo e, quando arrivi, ti accorgi che il treno ha 12 minuti di ritardo?

March 30, 2017

Stop sending email to new user in WordPress admin registration

Prevent WordPress to send notification emails when you manually create new users

March 9, 2017

Add Internet Explorer class to body to detect old browser

When you have clients that still uses an old browser, you need to handle it. This javascript function detects the…

February 27, 2017