Avoid an extra page when printing HTML documents

A trick to eliminate an extraneous page appearing for now reason

Teri Radichel
Bugs That Bite
Published in
2 min readSep 13, 2024

--

In an attempt to create a printable document I added the following to insert a page break:

<p class="c19" style="page-break-before:always;">

I tried adding the break before and break after but no matter what I would get an extra blank page. I am printing from Google Chrome to PDF.

I was reading so many stack overflow and other pages to no avail like these — which at the time of this writing do not include my solution to this annoying problem. The margin issue is interesting but did not solve my problem, nor did forcing the height of the page.

--

--

Teri Radichel
Bugs That Bite

CEO 2nd Sight Lab | Penetration Testing & Assessments | AWS Hero | Masters of Infosec & Software Engineering | GSE 240 etc | IANS | SANS Difference Makers Award