Element visible only on print page

后端 未结 1 1286

Im having problems with displaying ONLY some elements ONLY on print page. For example i have a page, where users can see print preview (simple javascript). On that print page im

1条回答
  •  伪装坚强ぢ
    2021-02-19 10:19

    I did somthing similar a while ago, this is how I did it:

    @media screen
    {
        .noPrint{}
        .noScreen{display:none;}
    }
    
    @media print
    {
        .noPrint{display:none;}
        .noScreen{}
    }
    
    
    Some content goes here

    AFAIK this is supported by all major browsers, even IE8 started to support it.

    0 讨论(0)
提交回复
热议问题