Note that there are some explanatory texts on larger screens.

plurals
  1. POHeight 100% causes unwanted scrollbars
    primarykey
    data
    text
    <p>I'm sure you have all seen a similar question before but nothing I've read fixes this. </p> <p>Basically I have a div with height 100% which fills the view port. Inside this div I have a h1 tag with height of 40px and a un-ordered list of height 100% to fill the remaining height of the page. </p> <p>Because of the 40px H1 tag, the page gets vertical scroll bars which I don't want. </p> <p>Another answer on a similar question was to add <code>overflow:hidden</code> to the div. This worked for a while but I found and issue with this. When I get a <strong>X</strong> amount of list items that my unordered list requires scroll bars, I cannot see the very bottom couple of items because of the <code>overflow: hidden</code> on the div. Please see the link below for a demo: (<a href="http://codepen.io/anon/pen/xcIsm" rel="nofollow">Here</a>).</p> <p>If anyone could help me out with this it would be much appreciated.</p> <p><strong>HTML:</strong></p> <pre><code>&lt;div&gt; &lt;h1&gt;Header&lt;/h1&gt; &lt;ul&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;li&gt;Test&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p><strong>CSS:</strong></p> <pre><code>html { height: 100%; } body, h1, ul { margin: 0; padding: 0; } body { height: 100%; } div { height: 100%; width: 300px; overflow:hidden; } h1 { height: 40px; line-height: 40px; } ul { list-style: none; background: red; height: 100%; overflow: auto; } </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.
 

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