Crossbrowser min-height


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

Only tested in Safari 3, Opera 9.5 and Firefox 2 (all Mac OS) for now, but it should actually work. If you run into any problems, please provide some feedback.


Copy this code and paste it in your HTML
  1. selector {
  2. height: 10em; /* min-height for IE. Must be declared above declaration for other browsers! */
  3. }
  4. selector:empty {
  5. min-height: 10em; /* min-height for browsers other than IE */
  6. height: auto !important; /* Override previously declared height for browsers other than IE */
  7. }
  8.  
  9. or even simpler:
  10.  
  11. selector {
  12. min-height: 10em; /* min-height for browsers other than IE */
  13. height: auto !important; /* Override declared height for browsers other than IE */
  14. height: 10em; /* min-height for IE */
  15. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.