简体   繁体   English

使用垂直滚动打印div的内容

[英]Printing the content of a div with vertical scroll

I have a div which has a fixed height and the content in it occupies more space than it's fixed height so I gave it an overflow-y:scroll . 我有一个div,它具有固定的高度,并且其中的内容比其固定的高度要占用更多的空间,因此我给了它一个overflow-y:scroll How do I print the entire content that is inside this div? 如何打印此div内的全部内容?

Can you just override the scroll and height settings for print, without breaking the rest of the page layout? 您可以仅覆盖滚动和高度设置以进行打印,而不会破坏其余页面布局吗?

@media print {
  #mydiv {
    height: auto;
    overflow-y: auto;
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM