title: Why do inline elements behave like block level elements when floated?
body: <p><strong>Where in the CSS spec does it define this behavior?</strong></p>
  
  <p>As stated in these two articles...</p>
  
  <p><a href="https://www.smashingmagazine.com/2007/05/css-float-theory-things-you-should-know/#what-you-should-know-about-floats" rel="nofollow">Smashing Magazine</a></p>
  
  <blockquote>
    <p>When you float an element it becomes a block box</p>
  </blockquote>
  
  <p><a href="https://css-tricks.com/almanac/properties/f/float/" rel="nofollow">CSS Tricks</a></p>
  
  <blockquote>
    <p>An element that is floated is automatically <code>display: block;</code></p>
  </blockquote>
  
  <hr>
  
  <p><strong>Example:</strong> <a href="https://jsfiddle.net/kennethcss/y6cmgubt/" rel="nofollow">https://jsfiddle.net/kennethcss/y6cmgubt/</a></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>a {
    /* for looks */
    background-color: #e1e1e1;
    line-height: 30px;
    text-align: center;
  
    /* Comment "float: left" out to test. Once the float is removed, neither
     * the height or width have any effect on the anchor because its default
     * display is inline.
     */
    height: 30px;
    float: left;
    width: 100px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;nav&gt;
    &lt;a&gt;Nav Item 1&lt;/a&gt;
    &lt;a&gt;Nav Item 2&lt;/a&gt;
    &lt;a&gt;Nav Item 3&lt;/a&gt;
  &lt;/nav&gt;</code></pre>
  </div>
  </div>
  </p>