简体   繁体   English

IE边缘可多打印一页,但不能在Chrome中打印

[英]IE edge print one extra page but not in Chrome

I've the modal window with scroll bar, while printing the modal window. 我有带滚动条的模态窗口,同时打印模态窗口。 I'm getting one extra blank page in IE edge. 我在IE Edge中得到了一个额外的空白页。 If I use the below CSS code I'm able to get what I want it for more than one page of data, that is if the modal have three pages of data, IE edge & chrome print exactly three pages that is perfect. 如果我使用下面的CSS代码,则可以为多于一页的数据获得所需的内容,也就是说,如果模态具有三页的数据,则IE edge和chrome可以精确地打印三页。 However If I have only one page of data in IE edge that's print one page data and one page blank page. 但是,如果我在IE边缘中只有一页数据,则打印一页数据和一页空白页。 however, this is perfectly working in Chrome (it print only one page data). 但是,这在Chrome中非常适合(它只打印一页数据)。 if I change to modal height to auto then it only print one page (In IE its works perfect).however if the modal has three page of data it prints only one page . 如果我将模式高度更改为自动,则仅打印一页(在IE中,它的工作原理很完美)。但是,如果模式具有三页数据,则仅打印一页。 Any help is greatly appreciated. 任何帮助是极大的赞赏。

@media print {
 .modal {
    height: 100%;
 }
.modal-body {
    height:100%;
    overflow: visible;
 }
}

Really need to see the HTML behind this, but I'm guessing the height:100% is pushing the page too tall in Edge and giving you that second page. 确实需要查看其背后的HTML,但是我猜想height:100%在Edge中将页面推得过高,并给了您第二个页面。 You probably don't need height:100% in your print stylesheet. 您可能不需要在打印样式表中使用height:100% Just use overflow:visible or maybe height:auto if you need to override a specific height used elsewhere in the CSS. 如果您需要覆盖CSS其他位置使用的特定高度,则只需使用overflow:visibleheight:auto

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

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