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.
With improved security, privacy, speed, and ease of use, Microsoft Edge surpasses the experience you've come to know with Internet Explorer. When you make the switch to Microsoft Edge, we'll automatically import your favorites, preferences, and other browsing data from Internet Explorer.
Definition of a "web browser" and links to support websites for further information and help. "A web browser, or simply 'browser,' is an application used to access and view websites. Common web browsers include Microsoft Edge, Internet Explorer, Google Chrome, Mozilla Firefox, and Apple Safari.
Firefox does not have an equivalent option. You can install an add-on that will switch to the IE rendering engine for sites that do not display properly in Firefox. It does this by opening IE within a Firefox tab.
The Edge icon, a blue letter "e," is similar to the Internet Explorer icon, but they are separate applications. To open Internet Explorer, open the Windows menu in the lower left corner of your screen and begin typing "Internet Explorer." IE will pop up in a search menu. Simply click on it to open.
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.
For example:
@media print { body { color-adjust: exact; } }
I cannot guarantee the widespread adoption on browsers for the drafted property, however it is currently working on the latest version of FireFox (at the time of writing, version 50.0).
[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 }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With