title: CSS: first-child selector including text nodes
body: <p>is there any way to select a CSS-element that is the first child of its parent, <em>counting text nodes</em>? I want to remove the top margin of a heading if it is at the top of its parent, but if I use:</p>
  
  <pre><code>#content h1 {
      margin-top: 1em;
  }
  #content h1:first-child {
      margin-top: 0;
  }
  </code></pre>
  
  <p>and have some HTML like</p>
  
  <pre><code>&lt;div id="content"&gt;
      This is some text.
      &lt;h1&gt;A heading&lt;/h1&gt;
      Some more text.
  &lt;/div&gt;
  </code></pre>
  
  <p>the margin is still removed. Is there any way in CSS to prevent this?</p>