我在处理两个 IMG 标签之间的额外填充 (4px) 时遇到了问题。在 Mac (Snow Leopard) 上的 Firefox 7.0.1、Safari 5.1.1、Chrome 11.0.696.68 和 Opera 10.53 中会发生这种情况。
我在这里上传了示例: http://husnoo.com/img_extra_space/img_extra_space.html
附上它的截图: http://husnoo.com/img_extra_space/shot.png
两个 IMG 之间的 4 个像素不应该存在。
谢谢!
纳瓦尔。
代码:
<!DOCTYPE html>
<html>
<head>
<title>Title here</title>
<style type="text/css">
body {
margin: 0px;
padding: 0px;
}
toolbar {
background-color: #ddd;
margin: 0px;
padding: 0px;
width: 32px;
height: 32px;
}
#tool1 {
background-color: #0dc;
margin: 0px;
padding: 0px;
width: 32px;
height: 32px;
}
#tool2 {
background-color: #6dc;
margin: 0px;
padding: 0px;
width: 32px;
height: 32px;
}
</style>
</head>
<body>
<div id="toolbar">
<img id="tool1" src="select.png">
<img id="tool2" src="transform_move.png">
</div>
</body>
</html>
最佳答案
不要在图像之间换行而不是
<img id="tool1" src="select.png">
<img id="tool2" src="transform_move.png">
做
<img id="tool1" src="select.png"><img id="tool2" src="transform_move.png">
关于css - IMG 之间的 CSS 中的额外填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8002188/