Skip to content

Instantly share code, notes, and snippets.

Created April 24, 2023 16:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Multi-page print test
<!DOCTYPE html>
<meta charset="utf-8" />
<title>Multi-page print test</title>
Print to PDF, landscape, letter size, no margins, enable background graphics.
Tested on Chrome.
body {
height: 100%;
margin: 0;
padding: 0;
.page {
page-break-inside: avoid;
break-inside: avoid;
page-break-before: always;
break-before: page;
background-image: radial-gradient(
circle at 50% 50%,
#00c 0%,
#002 100%
color: white;
padding: 1em;
height: 95%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.page:first-child {
page-break-before: avoid;
break-before: avoid;
<div class="page">
<h1>Slide 1</h1>
<p>Slide text.</p>
<div class="page">
<h1>Slide 2</h1>
<p>Slide text.</p>
<div class="page">
<h1>Slide 3</h1>
<p>Slide text.</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment