min-height for IE (and all other browsers)

Mark As Favorite CSS fix css ie minheight saved by 1 people
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.
  1. /* for browsers that don't suck */
  2. .container {
  3. min-height:8em;
  4. height:auto !important;
  5. }
  6.  
  7. /* for Internet Explorer */
  8. /*\*/
  9. * html .container {
  10. height: 8em;
  11. }
  12. /**/

Comments

posted on 2009-09-14 02:05:02+08:00 by david
http://htmlcsstutorials.blogspot.com/2009/06/how-to-have-div-min-height.html

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

All Code Snippets

Hot Code Snippets

New Code Snippets