html打印预览页面背景,HTML–无法打印背景颜色(CSS解决方案)?

更新时间:2023-07-09 23:54:29 阅读: 评论:0

工藤新一用日语怎么说html打印预览页⾯背景,HTML–⽆法打印背景颜⾊(CSS解决
英译汉翻译
⽅案)?
好吧,我认为你没有得到我在评论中的意思,反正,所以它很简单,⽐如我有⼀个元素,⽐如说
背景设置为番茄,所以为了使这项⼯作,⾸先你必须确保你有媒体打印设置,如
@media print {
/* Declarations go here */
爱屋及乌英语
}
要么
现在,你需要宣布的是
-webkit-print-color-adjust:exact;在物业区,像
@media print, screen { /* Using for the screen as well */
.
blow {
height: 100px;
广州mba辅导班>翌日是什么意思width: 100px;
background: tomato;
-webkit-print-color-adjust: exact;
}
}
Demo(仅适⽤于webkit浏览器,即Chrome / Safari)
在上⾯的演⽰中,您甚⾄可以在Chrome的打印预览窗⼝中看到红⾊块.
正如你评论的那样,它对我有⽤..
要么
⽀持相同的是脏的,有关该属性的更多信息,您可以参考MDN
From MDN :
Body element backgrounds are not printed
Currently neither
会计应聘
failuresChrome nor Safari print backgrounds of the body element. If this
property is t to exact for the body element, it will apply only to
its descendants.老友记剧本
绿尾虹雉Chrome clipped image bug
When background images are clipped (for example, when using
background-image sprites), due to 07002, they will
appear distorted when printed from the Chrome browr with
-
webkit-print-color-adjust: exact. Solid backgrounds and background images that are not clipped (i.e. have lower width and height than the
element to which they are applied) are printed correctly.
External linksoffduty
WebKit bug 07003: “WIP: Add CSS property to control printing of backgrounds for individual elements” CSSWG wiki:“07004” – a proposal to standardize this property

本文发布于:2023-07-09 23:54:29,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/78/1088171.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:打印   评论   背景   属性
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图