title: Header's height to margin-top
body: <p>I have a header with <code>position: fixed;</code>
   but the content that is after it remains behind the header.
  I've tried with JS to set the <code>margin-top</code> of the content with the header's height but doesn't work.</p>
  
  <p>Here you have the HTML:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;       
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;link rel="stylesheet" type="text/css" href="stylesheetini.css"&gt;
      &lt;script src="javas.js"&gt;&lt;/script&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;    
  &lt;body onscroll="scrolling()"&gt;
      &lt;div class="header"&gt;
      &lt;p&gt;Example&lt;/p&gt;
      &lt;/div&gt;                      
      &lt;div class="container"&gt;
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ut orci arcu. Morbi in neque libero. Pellentesque in tortor magna. Nam tempus suscipit sem id viverra. Duis blandit, massa sed tristique pharetra, mauris arcu convallis quam, id rutrum urna elit tristique mauris. Duis condimentum mi vel libero consectetur tempor. Ut tempor odio vitae neque varius, nec finibus leo rhoncus.
      &lt;/div&gt;              
      &lt;div class="footer"&gt;
          ExampleExample
      &lt;/div&gt;    
  &lt;/body&gt;    
  &lt;/html&gt;
  </code></pre>
  
  <p>The CSS:</p>
  
  <pre><code>body {
      background-color: #DFB36D;
      text-align: center;
  }
  
  .header {
      position: fixed;
      font-size: 50px;
      background-color: #BBBBBB;
      top: 0;
      left: 0;
      width: 100%;
  }
  
  .container {
  
  }
  </code></pre>
  
  <p>And the JS:</p>
  
  <pre><code>$(document).onload(){
          var headerHeight = $('.header').height() + 'px';
          $('.container').css('margin-top', headerHeight);
      }
  </code></pre>
  
  <p>Thanks in advance.
  <a href="https://jsfiddle.net/nxhoqcz9/http://" rel="nofollow noreferrer">https://jsfiddle.net/nxhoqcz9/</a></p>
  
  <p>Actually removed <code>&lt;center&gt;</code> tags and <code>.</code> from body</p>