title: CSS: page-break-before, always, except the first time?
body: <p>I'm trying to create a pretty-print html page. I need to force a page-break, between top-level constructs, so I added a CSS class to the top-level element of each construct, and set page-break-before:always in the CSS for that class. E.g.:</p>
  
  <pre><code>&lt;body&gt;
  &lt;div class="prettyprint"&gt;
      &lt;div class='toplevel'&gt;
          ...
      &lt;/div&gt;
      &lt;div class='toplevel'&gt;
          ...
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  
  .prettyprint .toplevel { page-break-before:always; }
  </code></pre>
  
  <p>My problem is I get a blank page, before the first top-level element.  Which makes perfect sense, considering what page-break-before:always is supposed to do.  But I don't want it.</p>
  
  <p>So, one option is to not include the "toplevel" class in the first element, or to provide a new "firsttoplevel" class that doesn't set page-break-before:always, and set it for the first top-level element, and then use "toplevel" for all the others.  I could do it, easily enough, but it seems like it's violating separation of concerns.</p>
  
  <p>So I was wondering if there was a way to do this in CSS?  To set a rule that would apply only to the first "toplevel" child of "prettyprint"?</p>
  
  <p>Any ideas would be appreciated.</p>