Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get a div to resize its height to fit container?
    primarykey
    data
    text
    <p>How can I get the div <strong>nav</strong> to have expand down or have the height the same as it's parent div (<strong>container</strong>)?</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; &lt;html&gt;&lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt; &lt;meta http-equiv="Content-Style-Type" content="text/css" /&gt; &lt;meta http-equiv="Content-Script-Type" content="text/javascript" /&gt; &lt;title&gt;&lt;/title&gt; &lt;style type="text/css"&gt; * {border:0; padding:0; margin:0;}/* Set everything to "zero" */ #container { margin-left: auto; margin-right: auto; border: 1px solid black; overflow: auto; width: 800px; } #nav { width: 19%; border: 1px solid green; float:left; } #content { width: 79%; border: 1px solid red; float:right; } &lt;/style&gt; &lt;div id=container&gt; &lt;div id=nav&gt; &lt;ul&gt; &lt;li&gt;Menu&lt;/li&gt; &lt;li&gt;Menu&lt;/li&gt; &lt;li&gt;Menu&lt;/li&gt; &lt;li&gt;Menu&lt;/li&gt; &lt;li&gt;Menu&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id=content&gt; &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam fermentum consequat ligula vitae posuere. Mauris dolor quam, consequat vel condimentum eget, aliquet sit amet sem. Nulla in lectus ac felis ultrices dignissim quis ac orci. Nam non tellus eget metus sollicitudin venenatis sit amet at dui. Quisque malesuada feugiat tellus, at semper eros mollis sed. In luctus tellus in magna condimentum sollicitudin. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur vel dui est. Aliquam vitae condimentum dui. Praesent vel mi at odio blandit pellentesque. Proin felis massa, vestibulum a hendrerit ut, imperdiet in nulla. Sed aliquam, dolor id congue porttitor, mauris turpis congue felis, vel luctus ligula libero in arcu. Pellentesque egestas blandit turpis ac aliquet. Sed sit amet orci non turpis feugiat euismod. In elementum tristique tortor ac semper.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </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