search

Home  >  Q&A  >  body text

css @media print has no effect in external stylesheet

Please help me see where the problem is. I made a form with a button. I want to control the button not to print. I defined an external css file for the form. Most styles can be implemented. , only the part where the button does not print is invalid, this part is written like this:

@media print

{

.noprint {display:none;}

}

享耳享耳2035 days ago1777

reply all(2)I'll reply

  • 张涛

    张涛2019-05-07 14:59:38

    What browser are you using? Some browsers do not support external css for print.

    The firefox I use can

    reply
    0
  • 享耳

    I use Google Chrome. I tried it again just now and found that there is a sentence in front of this place: .noprint {position:sticky;top:0px;}. Just comment out this sentence. I can’t think of the specific reason. The front is the screen style and the back is the print style. There should be no conflict.

    享耳 · 2019-05-07 15:57:59
  • Cancelreply