Html 如何在打印机上打印背景图像作为水印

Html 如何在打印机上打印背景图像作为水印,html,image,background,watermark,Html,Image,Background,Watermark,我有一个表的图像背景,具有以下语法 <div id="content"> There is some content in here </​div> style=“背景图像(URL)” <div id="content"> There is some content in here </​div> 问题是当我在打印机上打印它时,它没有打印 <div id="content"> There is some co

我有一个表的图像背景,具有以下语法

<div id="content">
    There is some content in here
</​div>
style=“背景图像(URL)”

<div id="content">
    There is some content in here
</​div>
问题是当我在打印机上打印它时,它没有打印

<div id="content">
    There is some content in here
</​div>
你能告诉我怎么得到这个吗

<div id="content">
    There is some content in here
</​div>
图像背景也可以作为水印打印在纸上

<div id="content">
    There is some content in here
</​div>
我需要任何代码不要求每个用户更改浏览设置

<div id="content">
    There is some content in here
</​div>

谢谢

这可以在浏览器中进行配置。打开“打印选项”时,会有一个选项询问您是否打印背景图像。:)

大多数浏览器都有打印背景的选项。在FF 3.6.3中,在文件-->页面设置-->打印背景(颜色和图像)

下,您可能已经从答案中注意到,默认情况下浏览器不打印背景图像。此外,也无法强制所有访问者的浏览器打印水印

<div id="content">
    There is some content in here
</​div>

强制打印水印的一种可能方法是创建一个div,该div位于包含水印的IMG标记的多次重复的内容下。这真是糟糕透顶。

用户可能无论如何都不想在背景上浪费墨水

<div id="content">
    There is some content in here
</​div>
我建议使用z索引为0的绝对定位div作为墙纸,使用z索引为1的绝对定位content div作为内容

<div id="content">
    There is some content in here
</​div>
为了缓解墨水问题,您可以使用css@media print指令将背景的不透明度更改为5到10%之间,使其更像水印

<div id="content">
    There is some content in here
</​div>
这是一把小提琴:

<div id="content">
    There is some content in here
</​div>
CSS:

<div id="content">
    There is some content in here
</​div>
HTML:

<div id="content">
    There is some content in here
</​div>

这里有一些内容

我注意到另一个答案被标记为正确,尽管它没有回答问题。这是我的照片。OP特别声明“我需要任何代码,不要求每个用户更改浏览器设置”。