Element visible only on print page

后端 未结 1 1277

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{}
    }
    
    <div class="noScreen">Some content goes here</div>
    

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

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