开发者

Preventing print icon getting printed

开发者 https://www.devze.com 2023-02-01 09:46 出处:网络
H开发者_如何学Pythonow to prevent print icon getting printed HTMLinside your head tag: <link rel=\"stylesheet\" href=\"print.css\" media=\"print\" />

H开发者_如何学Pythonow to prevent print icon getting printed HTML


inside your head tag:

<link rel="stylesheet" href="print.css" media="print" />

in print.css:

a#print-icon { visibility: hidden; }

(I don't know the actual selector as you didn't post your HTML. Please post your code in future questions. Have fun!)


Use the @media CSS selector. Simplified example:

<style rel="stylesheet" href="somestyle.css" />
<img src="/some/file.png" class="print_me_not" />

in somestyle.css:

@media print {
  .print_me_not {
    display:none;
  }
}


Use CSS Media Types.

Example:

<style type="text/css">
 @media print { 
  #yourPrintIcon { display: none; }
 }
</style>


another method: in your main css file:

@media print {
    #printerIcon { display: none; }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消