HTML
<div> <p>1</p> <p class="special">2</p> <p>3</p> </div>
CSS
@page{ size:3.5in 2in; marks:crop; bleed:0.125in; margin:0.25in; } @page special{ background:yellow; } div{ display:flex; justify-content: space-around; } p.special{ order:-1; page:special; }
JavaScript
/* Put your JavaScript here! But be aware that not all rendering tools are supporting JavaScript. */
Preview powered by paged.js
PDF rendered with  (https://weasyprint.org/)