What is the alternate for -webkit-print-color-adju

2019-04-18 10:42发布

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.

4条回答
等我变得足够好
2楼-- · 2019-04-18 11:13

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
}
查看更多
做个烂人
3楼-- · 2019-04-18 11:16

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]

查看更多
男人必须洒脱
4楼-- · 2019-04-18 11:19

There is no alternate CSS to print background colors in browsers other then chrome.

查看更多
SAY GOODBYE
5楼-- · 2019-04-18 11:30

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;
}
查看更多
登录 后发表回答