Posted By

travis on 06/29/06


Tagged

css minheight


Versions (?)

Who likes this?

18 people have marked this snippet as a favorite

jamesmcoats
meth
postNuKe
jkochis
fatihturan
basicmagic
tavo
purpleraison
SpinZ
marcoba
celoria
ds
johnself
esquareda
nhartjes
ijasnijas
gisu
atulkransingh


simple min-height for all browsers


 / Published in: CSS
 

This snippet uses html>body instead of * html. Works in all modern-browsers, degrades to just height for older browsers.

  1. #minHeightItem
  2. {
  3. height: 100px; /* this is the height that IE6 and other older browsers will use */
  4. }
  5.  
  6. /* "html>body" is preferred over other methods because it is valid CSS, it doesn't have problems with specificity that other methods have, and it is forwards compatible */
  7. html>body #minHeightItem
  8. {
  9. height: auto; /* reset the height for compliant browsers */
  10. min-height: 100px;
  11. }

Report this snippet  

You need to login to post a comment.