Create a cover page in PDF export

Things I have tried

Hello, I am trying to create a CSS snippet that will add a cover page to the top of a PDF with a background image and the title centered. I have it working so far to where it will export the PDF, add the background and center the title, but the background image will not stretch to the full width of the page

I have had little success setting margins to 0 but I might not be setting the correct margin.

This is my snipped currently:

@media print {
  h1, h2, h3, h4, h5, h6 {
    color: #f16724 !important;
  }
  h1 {
	page-break-after: always !important;
	text-align: center !important;
	padding: 400px 0 !important;
  }
  
  div {
	background-image: url("imgUrlHere") !important;
	background-repeat: !important;
  }
}

Before the big 1.0 update, this snippet was previously only adding the image to the div section I have defined at the top of my markdown page.

<div>Title Goes Here</div>

Currently, it adds the background image to every page.

What I’m trying to do

My end goal is one of two things:

  1. Have the background only on the top page with the title, and the rest of the pages be white.
  2. Have the background on all pages and have the paragraph text set to white. I can stretch the image across the whole page by removing the margins in export, but I cannot change the paragraph text to white for visibility on the black background.

I am OK with either working, but I cannot seem to get one or the other fully working. Any attempts I have made to change the paragraph text to white

p { color: white !important;}

result in the background being set to white and removing the background image.

Any help is much appreciated!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.