簡體   English   中英

為什么單擊“打印”按鈕時@media打印的選擇器無法顯示正確的格式?

[英]why selector of @media print is not displaying correct format when i click print button?

當我單擊“打印”按鈕時,文本應該顯示在“打印”對話框的四列中,但是在我編寫時顯示為段落。

 This are my script code where there is click event of print button. when i click it print dialog popup but the text which it suppose to show in four column shows it as a paragraphs. <script> $(document).ready(function () { $(document.body).on('click', '#btnPrint', function () { window.print(); }); }); </script> 
 my css code. @media print { .FourColumnClass { -webkit-column-count: 4; -moz-column-count: 4; column-count: 4; -webkit-column-gap: 40px; -moz-column-gap: 40px; column-gap: 40px; } } 
 my html code. <div class="clsbtn"> <button type="button" id="btnPrint">Print</button> </div> <div class="FourColumnClass"> my dog name is jonney. my dog name is jonney. my dog name is jonney. my dog name is jonney. my dog name is jonney. my dog name is jonney. my dog name is jonney. my dog name is jonney. my dog name is jonney. my dog name is jonney. </div> 

添加media="print"在你的<link rel="stylesheet" type="text/css" href="mystyle.css" media="print">在HTML頭

暫無
暫無

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

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