title: Do floated elements ignore padding?
body: <p><a href="https://stackoverflow.com/a/5013712/4932834">This</a> answer states that:</p>
  <blockquote>
  <p>When you float an element, it's effectively taking it out of the document flow, <strong>so adding padding to its parent won't have an effect on it</strong>. [...]</p>
  </blockquote>
  <p>Also <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/float" rel="nofollow noreferrer">MDN states</a> that:</p>
  <blockquote>
  <p>[...] when an element is floated it is taken out of the normal flow of the document. It is shifted to the left or right until it touches <strong>the edge of its containing box</strong> or another floated element.</p>
  </blockquote>
  <p>Well, somehow, I added padding to parent element and the floated one was shifted:</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{
      width: 100px;
      height: 100px;
      background-color: red;
      float: left;
  }
  
  #parent
  {
      padding: 100px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;body&gt;
      &lt;div id=parent&gt;
          &lt;div id=a&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  
  
      
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>