2

I have a "Print" button in my web page (php html) and I don't want it to print along with my data. Can I do it with CSS? Is there another way?

VolkerK
  • 93,904
  • 19
  • 160
  • 225
CMartins
  • 2,952
  • 4
  • 34
  • 52

3 Answers3

3

Yes you can with CSS, although support will only be with browsers that support CSS3.

But its simple:

 @media print {
    …
 }
Jamie Hutber
  • 24,715
  • 40
  • 159
  • 259
1

assign an id(buttonId) to the button eg: id="buttonId" and then in css:

#buttonId
{
    display:none;
}

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

just use the above css file for the same.

1

Just create multiple style sheets

<style type="text/css" media="all"> @import "nucss2.css";</style>
<link rel="stylesheet" type="text/css" media="print" href="print.css" />

And look at the

media="print"

Jordy van Eijk
  • 2,648
  • 2
  • 18
  • 34