我有一个固定位置样式的 div。当我使用 "cntr+p"
命令打印此 div 时,div 未显示全部内容。
The div is scrollable.
<div class="subtask-generate">
// Too much content in this div.
</div>
CSS:
.subtask-generate {
margin: 0 auto;
overflow-x: hidden;
overflow-y: auto;
padding: 0;
display: block;
width: 100%;
height: 100%;
position: fixed;
}
最佳答案
试试这个 CSS 规则。您只需在 @media only print
的规则中添加 overflow: visible;
。这应该适合您。
<style>
@media only print {
.subtask-generate {
width: auto;
height: auto;
overflow: visible;
}
}
</style>
关于html - Div 内容未在打印中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32269436/