Hide all elements except one div for print view

前端 未结 9 2092
无人及你
无人及你 2020-12-10 10:38

I have the following CSS for my print style:

* {
 display:none;
}

#printableArea {
 display:block;
}
9条回答
  •  北海茫月
    2020-12-10 11:19

    You might try popping it up on top of everything. This solved 90% of my problems, then I just had to make a .noprint class and add it to a few straggling elements.

    .print_area{
        position: fixed;
        top: 0px;
        left: 0px;
        width: 100%;
        z-index: 9999;
    
        background-color: #ffffff;
    }
    

提交回复
热议问题