I had some issues with the printing the background colors.
print-color-adjust made the background color issue solved in chrome.
body{
-webkit-print-color-adjust: exact;
}
What are the alternate CSS in firefox and IE for this.
I had some issues with the printing the background colors.
print-color-adjust made the background color issue solved in chrome.
body{
-webkit-print-color-adjust: exact;
}
What are the alternate CSS in firefox and IE for this.
As mentioned -webkit-print-color-adjust: exact
is specific to WebKit browsers, including Google's Chrome and Apple's Safari; therefore the code should work adequately in those aforementioned browsers with perhaps slightly varied results (depending on your site/app styling).
There have been proposals to standardize this snippet to work universally for not just browsers but for different devices too. The code is simplified to: color-adjust
. Similarly to the webkit-print-color-adjust
property, the possible values are the same for the proposed property economy | exact
.
If you want to use the property for printing purposes, simply use within a selector inside a @media print
query.
I cannot guarantee the widespread adoption on browsers for the drafted property, however it is currently working on the latest version of FireFox.
[Source]
There is the alternate CSS to print background colors for Chrome And Firefox.
td {
-webkit-print-color-adjust: exact;//:For Chrome
color-adjust: exact;//:For Firefox
}
This is beginning to work in Firefox (at least version 48.0.2) with the "color-adjust" property.
td {
background: #000 !important;
-webkit-print-color-adjust: exact;
color-adjust: exact;
}
There is no alternate CSS to print background colors in browsers other then chrome.