HTML中PNG图片的绝对定位的小问题,谢谢了

 <!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
*{margin:0; padding:0;}
.A{background:#ccc; width:800px; height:50px; position:relative; top:0; left:0;}
.B{width:130px; height:6px; background:black; position:absolute; top:0; left:0;}
</style>
</head>

<body>
<div class="A">
   <div class="B">
      <img src="jiantou.png" width="130" height="6" alt="dw"/>
   </div>
</div>
</body>
</html>

这是一张 高度6px, 宽度130px的PNG格式的图片
图片说明
打开后在浏览器这么显示的
图片说明

这是一个BUG吗?

改为:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
*{margin:0; padding:0;}
.A{background:#ccc; width:800px; height:50px;}
.B{width:130px; height:6px; background:black;}
</style>
</head>

<body>
<div class="A">
   <div class="B">
      <img src="jiantou.png" style="position:absolute" alt="dw"/>
   </div>
</div>
</body>
</html>


http://blog.sina.com.cn/s/blog_6c21f6480101cb33.html

试试直接把img放到divb里面做背景 而不是插入

img设置为块级元素或者设置vertical-align:top

http://stackoverflow.com/questions/1518576/unwanted-padding-bottom-of-a-div

DIV+CSS排版时 如何解决img图片元素下多余空白