在Firefox和IE中-webkit-print-color-adjust的替代方法是什么 [英] What is the alternate for -webkit-print-color-adjust in firefox and IE

查看:122
本文介绍了在Firefox和IE中-webkit-print-color-adjust的替代方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在打印背景色时遇到了一些问题。



print-color-adjust使背景色问题在chrome中得以解决。

  body {
-webkit-print-color-adjust:精确;
}

firefox和IE中的备用CSS 是什么

解决方案

如前所述 -webkit-print-color-adjust:精确特定于WebKit浏览器,包括Google的Chrome和苹果的Safari;因此,该代码应该可以在上述浏览器中正常工作,结果可能略有不同(取决于您的网站/应用样式)。不仅适用于浏览器,而且适用于不同的设备。该代码简化为: color-adjust 。与 webkit-print-color-adjust 属性类似,提议的属性 economy |的可能值相同。精确



如果要使用该属性进行打印,只需在 @media内的选择器中使用打印查询。



例如:

  @media print {
body {颜色调整:精确; }
}

我无法保证草稿财产会在浏览器中被广泛采用当前正在开发最新版本的FireFox(在撰写本文时,版本为50.0)。



[源代码]


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.

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]

这篇关于在Firefox和IE中-webkit-print-color-adjust的替代方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆