Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should be able to do this if you add in a div (<code>#header</code> below) to wrap your contents of 1.</p> <ol> <li><p>If you float <code>#header</code>, the content from <code>#someid</code> will be forced to flow around it.</p></li> <li><p>Next, you set <code>#header</code>'s width to 100%. This will make it expand to fill the width of the containing div, <code>#full</code>. This will effectively push all of <code>#someid</code>'s content below <code>#header</code> since there is no room to flow around the sides anymore.</p></li> <li><p>Finally, set <code>#someid</code>'s height to 100%, this will make it the same height as <code>#full</code>.</p></li> </ol> <p><a href="http://jsfiddle.net/G9cSZ/2/">JSFiddle</a></p> <p><strong>HTML</strong></p> <pre><code>&lt;div id="full"&gt; &lt;div id="header"&gt;Contents of 1&lt;/div&gt; &lt;div id="someid"&gt;Contents of 2&lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>CSS</strong></p> <pre class="lang-css prettyprint-override"><code>html, body, #full, #someid { height: 100%; } #header { float: left; width: 100%; } </code></pre> <hr> <p><strong>Update</strong></p> <p>I think it's worth mentioning that flexbox is well supported across modern browsers today. The CSS could be altered have <code>#full</code> become a flex container, and <code>#someid</code> should set it's flex grow to a value greater than <code>0</code>.</p> <pre class="lang-css prettyprint-override"><code>html, body, #full { height: 100%; } #full { display: flex; flex-direction: column; } #someid { flex-grow: 1; } </code></pre>
    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.
 

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