Balancing On Rails

January 14, 2008

Making a div 100% height - A side note

This has nothing to do with Rails. It has everything to do with CSS. If you have any situation where you want a div to span across the vertical height, here is the solution:

   1: html, body {
   2:     height: 100%; /*key point*/
   3: }
   4:  
   5: #longdiv {
   6:     height: 100%;
   7: }

This should work like a charm in all the browsers. If you have your div wrapped with another div, then don't forget to set the height of the wrapper div too!

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home