css - bootstrap 3 CSS 背景图像未显示在打印预览中

标签 css twitter-bootstrap background-image

我想给背景图片加水印,打印带水印图片的数据。我在没有打印预览的情况下在 div 中有水印。当我从浏览器使用打印对话框时,水印图像不会显示。我使用了 bootstrap 3 框架。 我的代码如下。

<div class="id-container"></div>

这是CSS:

.id-container{
   background: url('public/images/boat_trans.jpg') no-repeat center;
}
@media print{
   *{-webkit-print-color-adjust: exact;}
}

最佳答案

在最后添加 !important 解决了我的问题。

.id-container{
   background: url('public/images/boat_trans.jpg') no-repeat center !important;
}

关于css - bootstrap 3 CSS 背景图像未显示在打印预览中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53915629/

相关文章:

html - 图像 Sprite 尺寸大于容器,如何将其放入较小的容器中

objective-c - 标签栏图像的大小

css - ruby on rails : name of person on hover on a each. 做

css - 创建动态 div Razor MVC

html - bootstrap-select 选项列表仅与底层组件一样长

javascript - 任何分辨率下的 Twitter Bootstrap 折叠菜单

html - 仅在菜单栏上填充左文本

css - 需要修复视网膜 Sprite CSS 问题

css - 具有多个内容(img 和环绕文本)的 div 的垂直居中

css - SVG 图像在 IE9 的 CSS 背景中不起作用