title: CSS overflow:hidden with floats
body: <p>I read the <a href="https://www.w3schools.com/css/tryit.asp?filename=trycss_navbar_horizontal_float" rel="noreferrer">following code on w3schools</a> and do not understand how the <code>overflow</code> property would impact whether text appears to the right of the <code>ul</code> or not. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
  
  li {
    float: left;
  }
  
  a {
    display: block;
    width: 60px;
    background-color: #dddddd;
    padding: 8px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ul&gt;
    &lt;li&gt;&lt;a href="#home"&gt;Home&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#news"&gt;News&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#contact"&gt;Contact&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#about"&gt;About&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; overflow:hidden is added to the ul element to prevent li elements from going outside of the list.&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I know that <code>overflow:hidden</code> is used to handle content that goes outside of the box but don't understand how it applies in this instance.</p>