Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS: Set Div height to 100% - Pixels

Tags:

I have a header on my page which is just over 100px (111px to be exact) The div below it needs to extend to the bottom of the viewport, as if i had set the bottom to 0px. The problem lies in the fact that i cannot specify top and bottom in ie6 (bug).

I can either specify top: 111px or bottom: 0px, but i still need the height to be correct ie. 100% -111px, according to the size of the viewport.

Can't seem to get expressions working coz that seems to be the solution

Here's my css code:

position: absolute;  width: 200px;  top: 111px;  bottom: 0px; 

Any suggestions?

like image 524
moonblade Avatar asked Sep 02 '09 08:09

moonblade


1 Answers

The best way to do this is to use view port styles. It just does the work and no other techniques needed.

Code:

div{    height:100vh;  }
<div></div>
like image 52
Blaise M. Avatar answered Oct 24 '22 18:10

Blaise M.