CSS打印修复' background-size: cover; '
CSS printing fix of `background-size: cover;`
在打印网页时是否有跨浏览器修复启用background-image
与background-size: cover;
的组合?
我会欣赏各种解决方案,甚至那些使用JavaScript!
尝试如下:
在你的页面添加meta-tag:
<link rel="stylesheet" href="print.css" media="print" />
在print.css下一个标签中:
#mydiv {background-image: url('link/to/imagefile'); background-size:cover; display:block;}
在style.css (on screen)中:
#mydiv {display:none}