Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try changing your css to this:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>html, body { height: 100%; background-color: yellow; } header { width: 100%; height: 150px; background-color: blue; } header nav ul li { display: inline; padding: 0 30px 0 0; float: left; } #wrapper { min-height: 100%; height: auto !important; height: 100%; margin: 0 0 -30px 0; /* the bottom margin is the negative value of the footer's height */ position: relative; } #content { background-color: pink; width: 400px; padding: 25px 30px 25px 30px; position: absolute; bottom: 30px; top: 150px; margin-left: 100px; } footer { margin: -30px 0 0 0; width: 100%; height: 30px; background-color: green; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="wrapper"&gt; &lt;header&gt; &lt;div id="logo"&gt;&lt;/div&gt; &lt;nav&gt; &lt;ul&gt; &lt;li&gt;About&lt;/li&gt; &lt;li&gt;Menu&lt;/li&gt; &lt;li&gt;Specials&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;/header&gt; &lt;div id="content"&gt; content &lt;br&gt;goes &lt;br&gt;here &lt;/div&gt; &lt;/div&gt; &lt;footer&gt;footer&lt;/footer&gt;</code></pre> </div> </div> </p> <p>You probably don't want to be setting the width, padding, margins, ect. of the wrapper. Also, with absolute positioning you can pull the bottom and top of the content to where you want them.</p> <p>Here's <a href="http://jsfiddle.net/qC8z5/" rel="nofollow noreferrer">what you are after</a>, I think.</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