Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing CSS, how can I make my document expand to the user's viewport if the content doesn't scroll?
    primarykey
    data
    text
    <p>I'm having the hardest time understanding how <code>min-height</code> is supposed to work. I figured that if I placed it over a wrapping div, that it would expand accordingly.</p> <p>If your browser is large enough, there is a large space below the footer. I would like it if the footer was touching the bottom of the view port if there isn't much content. </p> <p>Otherwise, if there is a good amount of content, then the page should obviously scroll accordingly.</p> <p>My HTML document is set up like this (for the sake of brevity, I've removed all the content and am just showing the nesting structure):</p> <pre><code>&lt;div id="container"&gt; &lt;div id="top" class="five-box-shadow full-ten-border"&gt; &lt;div id="header" class="top-ten-radius"&gt; &lt;div id="logo"&gt; &lt;/div&gt; &lt;div id="topbar"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="nav" class="bottom-ten-radius"&gt; &lt;ul id="tabnav"&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="clearer"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div id="wrapper" class="full-ten-border five-box-shadow"&gt; &lt;div id="content" class="full-ten-border"&gt; &lt;div id="main"&gt;&lt;/div&gt; &lt;div id="secondary"&gt;&lt;/div&gt; &lt;div class="clearer"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div id="footer" class="bottom-ten-radius"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And the accompanying CSS that I thought would work:</p> <pre><code>#container { width: 880px; margin-left: auto; margin-right: auto; /*margin-top: 5px;*/ min-height:100%; } </code></pre> <p>Now, if I change <code>#container</code> to have <code>height: 100%</code>, it will stretch down but it will go too far and create scroll bars.</p> <p>What can I do? </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. 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