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>
最佳答案
尝试添加这个 CSS:
img { border: 0; }
关于html - 在 IE 和 Firefox 中打印预览图像周围的白色边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12844055/