Shon Levi Shon Levi - 1 year ago 55
HTML Question

100% div's outer and inner

I'm trying to make a div that will be 100% of the window (for that I use in the css fixed top 0 bottom 0 height 100%)

Inside that div I have more 2 div - one for title and one for content

The title div is 65px height, and I want the content div to be 100% of the left window (100% - 65px) - when I just give 100% it make it 100% but it goes "out" of window, because the 65px title div

How can I make the content div 100% - 65px ?

How can I get that to be 100% consider the title div...?

Answer Source

After discussing your problem in the comments, the best way to solve this in your case is to absolutely position the content element 65px from the top, like:

  top: 65px;
  bottom: 0;

However, if you don't have to support older browsers, you could also use CSS's calc() function:

  height: calc(100% - 65px);