“内部div”添加了3个像素的底部填充 [英] "a inside div" adds a bottom padding of 3 pixels

查看:88
本文介绍了“内部div”添加了3个像素的底部填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含< img> < a>



所有元素都是边框,填充,边距设置为0的样式。



图片的大小是div的大小,如firebug中所示。



Firebug显示链接不会扩展到img或div的整个大小。相反,它在底部占据一些空间,并在div下方延伸3个像素。
如何摆脱它们? a标签有 text-decoration:none;



谢谢。



<$>

p $ p> img {
display:block;
}

更新jsFiddle文件


I have a containing an <a> containing an <img>.

All elements are styles with border,padding,margin set to 0.

The size of the image is the size of the div, as shown in firebug.

Firebug shows the a link does not extend to the whole size of the img or div. Instead it occupies some space at the bottom, and extended 3 pixels below the div. How do I get rid of them? The a tag has text-decoration: none;

Thanks.

解决方案

mention display:block in the image style

img{
    display:block;
}

updated jsFiddle File

这篇关于“内部div”添加了3个像素的底部填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆