title: Using JavaScript to read html / body tag margin-top
body: <p>I'm trying to read "marginTop" style property from the <code>&lt;html&gt;</code> and <code>&lt;body&gt;</code> tags. Chrome developer tools shows margin-top as set via in-HTML CSS:</p>
  
  <pre><code>&lt;style type="text/css" media="screen"&gt;
  html { margin-top: 28px !important; }
  * html body { margin-top: 28px !important; }
  &lt;/style&gt;
  </code></pre>
  
  <p>However, when I try something like this:</p>
  
  <pre><code>console.debug(document.getElementsByTagName('html')[0].style.marginTop);
  console.debug(document.getElementsByTagName('body')[0].style.marginTop);
  </code></pre>
  
  <p>I get empty strings in both cases.</p>
  
  <p>jQuery's <code>offset()</code> function detects margins correctly. Unfortunately, I cannot use jQuery in this case, it has to be pure JavaScript.</p>
  
  <p>I would appreciate if someone could provide some insight on how I can read top margin property off the html and body elements.</p>