title: How to get margin in css when border to box?
body: <p>I have two <code>div</code> in my page. When I apply a border to these boxes, they get margin from top; but when no border is applied, the boxes are displayed with no margin. Why?</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>.header {
    width: auto;
    height: 100px;
    background-color: gray;
    text-align: center;
    line-height: 50px;
    border: 1px solid black;
  }
  
  .menu {
    background-color: green;
    height: 80px;
    border: 1px solid black;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="header"&gt;
    &lt;h1&gt;title&lt;/h1&gt;
  &lt;/div&gt;
  &lt;div class="menu"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>