【问题标题】:Print Preview White Border around image in IE and Firefox在 IE 和 Firefox 中打印预览图像周围的白色边框
【发布时间】:2012-10-11 16:14:55
【问题描述】:

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>

【问题讨论】:

    标签: html css print-css


    【解决方案1】:

    尝试添加这个 CSS:

    img { border: 0; }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-13
      • 2017-10-28
      • 2020-07-16
      • 2018-08-12
      • 2023-03-07
      • 1970-01-01
      • 2023-03-22
      • 1970-01-01
      相关资源
      最近更新 更多