Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Make the Content 100% height and equal height columns in this layout?
    primarykey
    data
    text
    <p>I have this layout where the my_menu is fixed at the top, followed by header, followed by content with 960px and centered, in which 3 columns have been floated left and finally followed by a sticky footer.</p> <ol> <li><p>The problem is How to make the content stretch to the 100% height even if there is not enough content in any one of the child columns?</p></li> <li><p>How make the 3 columns equal height regardless of any column's content?</p></li> <li>Maintain the sticky footer! Pure CSS, No JavaScript, No JQuery!</li> </ol> <p><strong>The HTML Markup</strong></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;title&gt;Document Title&lt;/title&gt; &lt;link rel="stylesheet" href="main.css" type="text/css" /&gt; &lt;/head&gt; &lt;body id="index"&gt; &lt;div id="wrapper"&gt; &lt;div id="my_menu"&gt; FIXED MENU WIDTH 100% &lt;/div&gt; &lt;div id="my_header"&gt; HEADER WIDTH 100% &lt;/div&gt; &lt;div id="content"&gt; &lt;p&gt;CONTENT 960px&lt;/p&gt; &lt;div id="col1" class="content_columns"&gt; COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% COLUMN 1 WIDTH 320px HEIGHT 100% &lt;/div&gt; &lt;div id="col2" class="content_columns"&gt; COLUMN 2 WIDTH 320px HEIGHT 100% COLUMN 2 WIDTH 320px HEIGHT 100% COLUMN 2 WIDTH 320px HEIGHT 100% COLUMN 2 WIDTH 320px HEIGHT 100% COLUMN 2 WIDTH 320px HEIGHT 100% COLUMN 2 WIDTH 320px HEIGHT 100% COLUMN 2 WIDTH 320px HEIGHT 100% COLUMN 2 WIDTH 320px HEIGHT 100% COLUMN 2 WIDTH 320px HEIGHT 100% &lt;/div&gt; &lt;div id="col3" class="content_columns"&gt; COLUMN 3 WIDTH 320px HEIGHT 100% COLUMN 3 WIDTH 320px HEIGHT 100% COLUMN 3 WIDTH 320px HEIGHT 100% COLUMN 3 WIDTH 320px HEIGHT 100% COLUMN 3 WIDTH 320px HEIGHT 100% &lt;/div&gt; &lt;div class="clear_floats"&gt;&lt;/div&gt; &lt;!-- For Clearing Floats --&gt; &lt;/div&gt; &lt;div class="push"&gt;&lt;/div&gt; &lt;!-- For Sticky Footer --&gt; &lt;/div&gt; &lt;div id="my_footer"&gt; STICKY FOOTER WIDTH 100% &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>The CSS Styles</strong></p> <pre><code>* /* For CSS Reset */ { padding: 0; margin: 0; } html, body { width: 100%; height: 100%; } div#wrapper { width: 100%; height: 100%; min-height: 100%; /* For Sticky Footer */ height: auto !important; /* For Sticky Footer */ margin: 0 auto -70px; /* For Sticky Footer */ } div#my_menu { width: 100%; height: 50px; outline: 1px solid black; background-color: grey; text-align: center; position: fixed; } div#my_header { width: 100%; height: 100px; outline: 1px solid black; background-color: yellow; text-align: center; padding-top: 50px; } div#content { width: 960px; margin: 0 auto; outline: 1px solid black; background-color: brown; text-align: center; } div.content_columns { width: 320px; outline: 1px solid black; background-color: gold; text-align: center; float: left; } div.clear_floats /* For Clearing Floats */ { clear: both; } div#my_footer { width: 100%; height: 70px; outline: 1px solid black; background-color: pink; text-align: center; } div.push /* For Sticky Footer */ { height: 70px; } </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.
 

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