我的打印样式有以下CSS:
I have the following CSS for my print style:
* { display:none; } #printableArea { display:block; }我希望这可以隐藏所有元素,并且只显示printableArea,但是所有都被隐藏了.在打印视图中,我得到的只是一个空白页.
I expected this to hide all elements, and only show the printableArea, however everything gets hidden. In print view, all I get is a blank page.
我已将其正确包含在HEAD中,并在此特定样式表上包含media="print".
I have it included properly in the HEAD, with media="print" on this particular stylesheet.
推荐答案如果未显示元素,则不会显示其任何子元素(无论其显示属性设置为什么).
If an element is not displayed, then none of its children will be displayed (no matter what their display property is set to).
*与<html>元素匹配,因此整个文档都被隐藏了.
* matches the <html> element, so the entire document is hidden.
您需要对隐藏的内容更具选择性.
You need to be more selective about what you hide.
更多推荐
隐藏除一个div以外的所有元素以进行打印视图
发布评论