繁体   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