为什么Internet Explorer 8打印不可见内容? [英] Why does Internet Explorer 8 print invisible content?

查看:143
本文介绍了为什么Internet Explorer 8打印不可见内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请检查下面的HTML代码。第三个DIV是部分可见的,因为它覆盖了第二(它有一个白色背景)。到目前为止,所有好的一切都在IE和Firefox正确显示。

please check the HTML code below. The 3rd DIV is partially visible because it is overlayed by the 2nd (which has a white background). All good so far, everything displays correctly in both IE and Firefox.

当我打印页面时,问题开始。在Firefox中,它按照页面上的显示打印。在Internet Explorer 8它以某种方式完全打印所有DIVS。它看起来像是在第二个DIV(或所有)应用一个不透明度过滤器,使第三个DIV完全可见...

The problem starts when I print the page. In Firefox it prints as displayed on the page. In Internet Explorer 8 it somehow prints all DIVS completely. It looks as if it applies a opacity filter on the 2nd DIV (or all) which makes the 3rd DIV completely visible...

我创建一个带有新内容的白色覆盖(在javascript中)的打印版本的页面。因为上面描述的问题,它不能正常工作,因为覆盖下面的所有内容也被打印...

I create a white overlay with new contents (in javascript) for a Print version of a page. Because of the issue described above it doesn't work correctly because all content below the overlay is also printed...

为什么IE8打印这个不可见的内容?是否有解决方案?

<html>
<head>
</head>
<body>

<div style="background-color:#999999;position:relative;border:solid 1px black;width:500px;height:500px;">     
    <div style="position:absolute;width:300px;height:200px;top:5px;left:5px;border:dashed 1px #cccccc;z-index:99;background-color:white;"></div>
    <div style="position:absolute;width:100px;height:200px;top:100px;left:50px;border:dashed 5px #cccccc;z-index:98;background-color:white;"></div>
</div>



</body>
</html>


推荐答案

IE有一个选项:

工具/ Internet选项/高级/打印/打印背景颜色和图像

Tools / Internet Options / Advanced / Printing / Print background colours and images

默认关闭。这是为什么在打印时忽略您的背景颜色样式。

which is off by default. This is why it's ignoring your background-color styles when printing.

这篇关于为什么Internet Explorer 8打印不可见内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆