Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's not a great idea to use <code>display: table</code> or the <code>float</code> property for layout. Tables are for tabular data, and floats are designed to allow text to flow around them in paragraphs. You can easily solve this problem by assigning <code>position: absolute</code> to your <code>#navbar</code> element and adjusting a few properties elsewhere to make the layout act as desired.</p> <p><s></p> <pre><code>#navbar { padding: 33px 0px 0px 0px; float: left; } </code></pre> <p></s></p> <pre><code>#navbar { position: absolute; height: 100%; } #container { position: relative; } #nav-bar ul { margin: 33px 0 0; } </code></pre> <p>I changed the <code>margin</code> on <code>#nav-bar ul</code> because the navbar's padding was causing it to increase in height past the page's limit. If you need more info on absolute positioning, further reading can be done <a href="http://www.w3.org/TR/CSS21/visuren.html" rel="nofollow">here</a>.</p> <p>This solution will work without javascript and will work on almost all browsers.</p> <p>Edit: since you want the page to change depending on the height of the user's screen and the height of the <code>#content</code> div, you can use a jQuery one-liner to check to see if the <code>#content</code> div is tall enough or not.</p> <pre><code>($('#content').offset().top+$('#content').height() &lt; $(window).height())?($('#content').height($(window).height()-90-$('#content').offset().top)):null; </code></pre> <p>This code is equivalent to saying "If the content div's height and offset is below the height of the window, increase the content div's height to exactly the height it needs to be to fill the window, otherwise do nothing."</p>
    singulars
    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