Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is the solution I came up with, ended up fairly simple using CSS only, although a javascript solution would have been nice to make it even simpler, oh well.</p> <p>To simplify this, the basics are the following code to get this to work:</p> <p><strong>CSS:</strong></p> <pre><code>body, html { height:100%; margin:0; padding:0; } div { box-sizing:border-box; box-sizing:content-box\9; /* Fix for IE9 sizing */ -moz-box-sizing:border-box; /* Fix for firefox */ } .column { position:absolute; width:100%; min-height:100%; height:auto; overflow:hidden; } .pane { position:absolute; width:100%; overflow:hidden; } .fill { height:auto; overflow:auto; } .top { background:pink; height: 20%; top:0; } .middle { background:red; top:20%; bottom:50px; } .bottom { background:orange; height: 50px; bottom:0; } /* Fix for Safari scrollbars (also styles Chrome scrollbars) */ .fill::-webkit-scrollbar {-webkit-appearance: none;width: 10px;} .fill::-webkit-scrollbar-track {background-color: rgba(0,0,0, .3);border-radius: 0px;} .fill::-webkit-scrollbar-thumb {border-radius: 0px; background-color: rgba(255,255,255, .4);} </code></pre> <p><strong>HTML:</strong></p> <pre><code>&lt;div class="column"&gt; &lt;div class="pane top"&gt;Top&lt;/div&gt; &lt;div class="pane middle fill"&gt;Middle&lt;/div&gt; &lt;div class="pane bottom"&gt;Bottom&lt;/div&gt; &lt;/div&gt; </code></pre> <p>JSFiddle: <a href="http://jsfiddle.net/xY3jr/3/" rel="nofollow">http://jsfiddle.net/xY3jr/3/</a></p> <p>For a complex version of this you can look at this JSFiddle: <a href="http://jsfiddle.net/8BHM6/8/" rel="nofollow">http://jsfiddle.net/8BHM6/8/</a></p>
 

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