簡體   English   中英

如何在打印時使div寬度和高度100%

[英]How to make div width and height 100% while printing

您好,我的頁面上實現了fullcalendar.js,但是無法打印整個頁面的日歷。 這是我的html

<body>
  <table>
    <tr>
      <td width = 25% > hello </td>
      <td> <div id='calendar'></div></td>
   </tr>
</table> </body>

現在,如果我嘗試打印此圖像,那么我的左邊就是空白。

<style>
    @media print {
    body * {
    visibility: hidden;
    }
    #calendar,
    #calendar * {
    visibility: visible;
    }

    }

因此,如何在此處打印僅占整個頁面的div #calendar是我的實現http://plnkr.co/edit/SsYdQn?p=preview

嘗試@page聲明。

將以下樣式規則添加到頁面。 它將刪除所有側面的所有空格。

<style type='text/css'>
@page{margin:0;size:auto}
</style>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM