title: CSS Page-Break Not Working in all Browsers
body: <p>I'm having trouble getting this working in most browsers, except for IE (it even works correctly in IE6) and Opera.</p>
  
  <p>Firefox separates the divs correctly but only prints the first page.</p>
  
  <p>Chrome and Safari only applies the page break to the last div.</p>
  
  <p>How can I get this working across all browsers correctly?</p>
  
  <p>The HTML:</p>
  
  <pre><code>&lt;div id="leftNav"&gt;
    &lt;ul&gt;
      &lt;!--links etc--&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div id="mainBody"&gt;
   &lt;div id="container"&gt;
    &lt;div class="pageBreak"&gt;
     &lt;!--content--&gt;
    &lt;/div&gt;
    &lt;div class="pageBreak"&gt;
     &lt;!--content--&gt;
    &lt;/div&gt;
    &lt;div class="pageBreak"&gt;
     &lt;!--content--&gt;
    &lt;/div&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The divs with the IDs <code>#leftNav</code> and <code>#mainBody</code> are are set to <code>float:left</code>, so they display nicely.</p>
  
  <p>I only want to print the <code>.pageBreak</code> classes, hiding the <code>#leftNav</code> and the rest of the <code>#mainBody</code> with CSS.</p>
  
  <p>The CSS: </p>
  
  <pre><code>@media print
  {
   #leftNav
   {
    display:none;
   }
   #mainBody
   {
    border:none;
    margin:none;
    padding:none;
   }
  }
  </code></pre>