simple min-height for all browsers

/ Published in: CSS
Save to your folder(s)

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

Copy this code and paste it in your HTML
  1. #minHeightItem
  2. {
  3. height: 100px; /* this is the height that IE6 and other older browsers will use */
  4. }
  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


RSS Icon Subscribe to comments

You need to login to post a comment.