JS 打印图片
在使用.print()进行打印时,打印的内容可能会包含图片内容,此时的图片内容不能设置为背景图片,否则将无法再打印页面显示。
doctype html>
<html><head><title>title><script type="text/javascript">function printfun(){window.print();}script>head><body><input type="button" value="打印" onclick="printfun()"><br/>下面设置的img图片:<div><img src="images/moganna.png">div>下面图片是背景图片:<div style="background: url('images/moganna.png'); width: 500px; height: 291px;">div>body>
html>