zoukankan      html  css  js  c++  java
  • 浏览器横向打印

    1、用横向打印的css样式,但实际使用发现只有谷歌浏览器能生效

    @page {size: landscape;} 

    2、用要打印的内容放到一个div中,然后用css样式把div旋转90度。

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>    
        <style type="text/css">
            @media print
            {
                .noprint
                {
                    display: none;
                }
               .divPint
               {
                   -webkit-transform: rotate(-90deg);
                    -moz-transform: rotate(-90deg);
                    -ms-transform: rotate(-90deg);            
                     position:absolute;left:-100px;
                     width: 960px;height:500px;margin-top:250px;
             border:solid 1px black;
                     display:block;
                }
                
                .divShow
                {
                    display:none;
                }            
            }
            
            @media screen 
            {
                 .divPint
                {              
                      display: none;
                }
                
                .divShow
                {
                    padding: 10px; margin: 0px auto; width: 960px;height:500px;border:solid 1px black;
                } 
            }    
                 
                   
        </style>
    </head>
    <body style='padding: 0px; margin: 0px;'>
        <form id="form1" runat="server">
        <div>
            <div class='divPint'> 
             我是打印的div
            </div> 
            <div class='divShow'> 
            我是显示的div
            </div>    
        <div style="padding-top: 20px; text-align: center;" class="noprint" id="tool" runat="server">
            <input id="Button1" type="button" value="打印" onclick='javascript:window.print();' />&nbsp;&nbsp;<input
                id="Button2" type="button" value="关闭" onclick='javascript:window.close();' />
        </div>
        </div>
        </form>
    </body>
    </html>
  • 相关阅读:
    printf输出函数
    死循环的3种编写方案
    volatile 和const 变量的使用
    arm mov 指令
    arm ldr 指令
    arm str 指令
    Ztree-
    端口占用问题:java.net.BindException: Address already in use: bind
    模块和包
    序列化模块:json、pickle、shelve
  • 原文地址:https://www.cnblogs.com/goding/p/13961104.html
Copyright © 2011-2022 走看看