zoukankan      html  css  js  c++  java
  • JS 打印图片

    在使用window.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');  500px; height: 291px;">
            
            </div>
        </body> 
    </html>

                                                                                                                        

  • 相关阅读:
    遥控器拆卸记录
    计算器拆卸记录
    no matching constructor for initialization
    STL
    排序方法
    二叉树之广度优先遍历
    C++之queue学习记录
    方向电路
    站间联系电路
    求二叉树的最大深度
  • 原文地址:https://www.cnblogs.com/wind-wang/p/6905025.html
Copyright © 2011-2022 走看看