Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've done similar, but use JavaScript to do it for me as well. It's not the most elegant JS but it works. I used this when I had a div that needed to be maximum size, and it had a side bar, top and bottom bar etc. So when the browser window was resized I had to quickly adjust the container div (which was a map).</p> <p>You want your markup to look like (I think you have this already):</p> <pre><code>&lt;div id="container"&gt; &lt;div id="title"&gt;Title&lt;/div&gt; &lt;div id="main"&gt;&lt;/div&gt; &lt;div id="footer&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Script:</p> <pre><code>var browserWidth = 0; var browserHeight = 0; function getSize() { if( typeof( window.innerWidth ) == 'number' ) { //Non-IE isIE = false; browserWidth = window.innerWidth; browserHeight = window.innerHeight; } else if( document.documentElement &amp;&amp; ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' browserWidth = document.documentElement.clientWidth; browserHeight = document.documentElement.clientHeight; } else if( document.body &amp;&amp; ( document.body.clientWidth || document.body.clientHeight ) ) { //They're not running IE7 / FireFox2. Older browser. Find some technology //to destroy their computer so they're forced to upgrade. browserWidth = document.body.clientWidth; browserHeight = document.body.clientHeight; } } function updateMapSize() { //IE7 is 21 pixels LESS than FireFox. //Pretty much we want to keep the map to the maximum size alloted. getSize(); //top section var height = browserHeight - 200; document.getElementById("main").style.height = height; document.getElementById("container").style.height = browserHeight ; document.getElementById("container").style.width= browserWidth ; setTimeout("updateMapSize()", 250); } </code></pre>
    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. This table or related slice is empty.
    1. This table or related slice is empty.
    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