每个打印页面上的HTML设置页脚图像 [英] HTML set footer image on each print page
本文介绍了每个打印页面上的HTML设置页脚图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以在每个打印页面上设置文本,但是如果我必须将图像设置为文本,我需要进行哪些必要的更改?这是我到目前为止使用的代码:
I am able to set text on every print page but if I have to set image in place of text, what necessary changes do I have to make? Here's the code I have used so far:
<div class="divFooter">UNCLASSIFIED</div>
CSS:
<style type="text/css">
@media screen {
div.divFooter {
display: none;
}
}
@media print {
div.divFooter {
position: fixed;
bottom: 0;
}
}
</style>
谢谢.
推荐答案
尝试如下操作:
@media print {
div.divFooter {
position: fixed;
background: url(http://path/to/image.png);
height: 100px; /* put the image height here */
width: 100px; /* put the image width here */
bottom: 0;
}
}
当然,您也可以执行类似的操作,而无需使用任何额外的CSS:
Of course, you can also do something like this instead without using any extra CSS:
<div class="divFooter"><img src="..." /></div>
有很多选择,这实际上取决于您要完成的工作.
There are lots of options, it really depends on what exactly you want to accomplish.
这篇关于每个打印页面上的HTML设置页脚图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文