title: Selecting the last element on page (paged media)
body: <p>I want to select the last element on a printed page. For example, given this HTML (assuming the printed page has a height of 100px):</p>
  
  <pre><code>&lt;!-- other content before --&gt;
  
  &lt;div id="TheThing"&gt;
    &lt;section id="a"&gt;Some content&lt;/section&gt;
    &lt;section id="b"&gt;Some content&lt;/section&gt;
    &lt;section id="c"&gt;This will be the last section on the page&lt;/section&gt;
    &lt;section id="d"&gt;This section will start on the next page&lt;/section&gt;
    &lt;section id="e"&gt;This is the last section&lt;/section&gt;
  &lt;/div&gt;
  
  &lt;!-- other content after --&gt;
  </code></pre>
  
  <p>and this CSS:</p>
  
  <pre><code>#TheThing {
    page-break-before: always;
    page-break-after: always;
  }
  
  section {
    height: 30px;
    border-bottom: solid 1px black;
    page-break-inside: avoid;
  }
  </code></pre>
  
  <p>I want to be able to select the <strong>last element on each printed page</strong>, in this case <code>#c</code> (and also <code>#e</code>, although if necessary, this could be easily excluded with <code>:not(:last-child)</code>) and remove its border.</p>
  
  <p>Approximation of desired output:</p>
  
  <p><a href="https://i.stack.imgur.com/2mAQG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2mAQG.png" alt="Desired output"></a></p>
  
  <p>Currently I'm using Prince XML. I prefer not to do with it JavaScript.</p>
  
  <p>Is it possible?</p>