I am trying to format a webpage for printing. The first page is a cover page with full bleed background. The rest of the pages have a margin.
@page {
margin: 2cm;
}
@page :first {
margin: 0;
}
.cover {
display: block;
height: 100%;
width: 100%;
background-color: green;
page-break-after: always;
}
<div class="cover"></div>
<p>HUGE BLOCK OF BODY TEXT...</p>
The first page looks perfect with no margin, but all the remaining pages with the margin have the text cut off.
The problem seems to be the first page. When I comment out the the margin: 0 for the first page, all the remaining pages look correct.
Is there a correct way to change margins using @page :first that doesn't affect the remaining pages?