在IE和Firefox中打印预览白色边框图像

时间:2012-10-11 16:14:55

标签: html css print-css

Firefox和IE在进行打印预览时显示图像周围的边框。这是一个带有两个div的简单页面,每个div包含一个400px的图像宽度,容器div为800px。我不希望在进行打印预览时我得到的两个图像之间有白色边框。我在这里做错了吗? (在chrome中,它不显示白色边框。)

我也尝试过这个代码用于打印css,但没有运气..

<style type="text/css" media="print">
.test{float:none;display:inline;  border:none;}
img{border:0;}
</style>

代码是:

<!DOCTYPE html>
<html>
<head>
<style type="text/css" media="print">
.test{float:left; display:inline; border:none;}
</style>
</head>

 <body>
 <div style="width:800px;margin:0px auto;">
 <div class="test" style="float:left;width:400px;">
 <img src="1334300111712.jpg">
 </div>
 <div class="test" style="float:left;width:400px;">
<img src="1334300115318.jpg">
 </div>
  </div>
</body>

</html>

enter image description here

1 个答案:

答案 0 :(得分:0)

尝试添加此CSS:

img { border: 0; }
相关问题