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?
Background problem with topic in HTML and Print media
Background problem with topic in HTML and Print media
You do not have the required permissions to view the files attached to this post.
-
- Sr. Propeller Head
- Posts: 133
- Joined: Sun Feb 03, 2013 6:01 pm
Re: Background problem with topic in HTML and Print media
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:
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:
I hope that helps,
-jeff
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;
}
}
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;
}
}
-jeff