Background problem with topic in HTML and Print media

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
francoud
Jr. Propeller Head
Posts: 1
Joined: Mon Apr 11, 2022 1:29 am

Background problem with topic in HTML and Print media

Post by francoud »

Hello,
I created a project with 2 different targets: one PDF (print) and one HTML (web). Print PDF file is displayed with white background, HTML file in web browser is displayed in grey background.
When I want to update a topic (common to the 2 targets), the background of the HTML layout is displayed for the 2 targets.
The file attached shows you the topic with the 2 different layouts: web layout with grey background and print layout with grey background.
The topic with print layout must be displayed with white background. Each background is defined in each stylesheet.
Do you know how the topic could be displayed for print layout in white?
You do not have the required permissions to view the files attached to this post.
Chicago_HPT
Sr. Propeller Head
Posts: 133
Joined: Sun Feb 03, 2013 6:01 pm

Re: Background problem with topic in HTML and Print media

Post by Chicago_HPT »

Depending on what you need to have a white background, you can use the !important rule to override other colors for your PDF output.

For example, I'll use the print media to set the background color for the body tag like so:

Code: Select all

@media print {
   body {
      background-color: white !important;
   }
}
Now, the background of the body tag will pretty much always be white for print media. If you need to set it for other, specific tags, you can do the same for them.

If you simply want the background color for all HTML elements to be white then you can set all elements using an asterisk, like so:

Code: Select all

@media print {
   * {
      background-color: white !important;
   }
}
I hope that helps,
-jeff
Post Reply