CSS How to set div height 100% minus nPx

Martijn picture Martijn · Jul 28, 2009 · Viewed 213.8k times · Source

I have a wrapper div which contans 2 divs next to each other. Above this container I have a div that contains my header. The wrapper div must be 100% minus the height of the header. The header is about 60 px. This is fixed. So my question is: how do I set the height my wrapper div to be 100% minus the 60 px?

<div id="header"></div>
<div id="wrapper">
  <div id="left"></div>
  <div id="right"></div>
</div>

Answer

libjup picture libjup · Feb 5, 2013

In CSS3 you could use

height: calc(100% - 60px);