简体   繁体   English

“内部div”添加了3个像素的底部填充

[英]“a inside div” adds a bottom padding of 3 pixels

I have a containing an <a> containing an <img> . 我有一个包含<img><a>

All elements are styles with border,padding,margin set to 0. 所有元素都是样式,边框,填充,边距设置为0。

The size of the image is the size of the div, as shown in firebug. 图像的大小是div的大小,如firebug所示。

Firebug shows the a link does not extend to the whole size of the img or div. Firebug显示链接没有扩展到img或div的整个大小。 Instead it occupies some space at the bottom, and extended 3 pixels below the div. 相反,它占据了底部的一些空间,并在div下方延伸了3个像素。 How do I get rid of them? 我怎么摆脱他们? The a tag has text-decoration: none; a标签有text-decoration: none;

Thanks. 谢谢。

mention display:block in the image style 提示display:block图像样式中的display:block

img{
    display:block;
}

updated jsFiddle File 更新了jsFiddle文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM