title: CSS - How to make a div's padding not affect the positioning of the div below it
body: <p>So I have two boxes:
  <a href="https://jsfiddle.net/anaegm/trajtmgf/" rel="nofollow noreferrer">https://jsfiddle.net/anaegm/trajtmgf/</a></p>
  
  <p>My original intention was to make <code>box-1</code> expand its height from the top and bottom when you hovered over it (as opposed to just "growing down" by adding padding), so I added a negative margin-top under the :hover to achieve this effect, and it works.</p>
  
  <p>The problem is that <code>box-2</code> below gets pushed down when you hover over <code>box-1</code>, and I need the second box to stay in its original position at all times. I tried adding a margin at the top of <code>box-2</code>, but this doesn't work. What are my options?</p>
  
  <p>EDIT: Since I'm working with dynamic text for the actual page I'm doing, I'd rather not use a set height for a div container for <code>box-1</code>.</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>#box-1 {
    color: #fff;
    background-color: #e91d23;
    text-align: center;
    cursor: pointer;
    width: 100px;
    padding-top: 30px;
    padding-bottom: 30px;
  }
  #box-1:hover {
    background-color: #5A5A5A;
    margin-top: -10px;
    padding-top: 40px;
    padding-bottom: 40px;
  }
  #box-2 {
    width: 100px;
    background-color: white;
    text-align: center;
    padding-top: 30px;
    padding-bottom: 30px;
    margin-top: 50px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="box-1"&gt;
    Box 1
  &lt;/div&gt;
  &lt;div id="box-2"&gt;
    Box 2
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>