Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You'll have to subtract the height of the navbar from the 100%. There are several solutions, many of which will include JavaScript but you won't need that.</p> <p><strong>1: box-sizing</strong></p> <p>Give the navbar an absolute position. Then you have the issue of the content of the other elements disappearing below it. Then comes the next trick: add a top-padding the size of the navbar. And the last trick: add <code>box-sizing: border-box;</code> to the <code>.sidebar</code> and <code>.body</code>. For better browser support you also need -moz- and -webkit- prefixes like so: <code>-moz-box-sizing:</code></p> <p>Example: <a href="http://jsfiddle.net/W2zkL/" rel="nofollow noreferrer">Fiddle to box-sizing</a></p> <p><strong>2: Actually subtract.</strong></p> <p>use <code>.body, .sidebar{ height: calc(100% - 40px);</code> Browser support is <s>very minimal for this from what I know</s> less than for box-sizing, so I would recommend the first solution. <a href="http://css-tricks.com/a-couple-of-use-cases-for-calc/" rel="nofollow noreferrer">Calc explained on css-tricks</a></p> <p><strong>3: Flexbox(added anno 2015)</strong></p> <p>You should now probably go with using calc when you know the height but an awesome replacement for using tables is flexbox. This is really my saviour for complex designs in responsive websites. By using one of the best features - <code>flex-shrink: 0</code> - on the header you can force other elements into adjusting themselves to fill the rest of the container.</p> <p>An old answer is probably not the best place to write down an extensive guide on flexbox so, again, a great link to <a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" rel="nofollow noreferrer">css-tricks</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload