Hide all elements except one div for print view

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

I have the following CSS for my print style:

* {
 display:none;
}

#printableArea {
 display:block;
}
9条回答
  •  忘掉有多难
    2020-12-10 11:08

    You're taking the right general approach, but you want to use visibility: hidden instead of display: none so that you can set child elements to be visible.

    See Print

    only?

提交回复
热议问题