问题描述
我有一个div标签通过CSS样式。我将填充设置为10px(填充:10px),它的工作原理就像我想在Firefox和IE7,但在IE6它添加了额外的填充底部(约2-3px我想)。任何人都知道这里发生了什么?
I have a div tag styled through CSS. I set the padding to 10px (padding:10px), it works just as I wanted in Firefox and IE7, but in IE6 it adds additional padding at the bottom (about 2-3px I think). Anyone has idea about what's happening here?
[update]
'm谈论有一个背景图像。当我删除背景图像,底部的额外填充消失。任何想法?
I just noticed this, the div tag I'm talking about has a background-image. When I removed the background-image, the extra padding on the bottom disappears. Any ideas?
[另一个更新,代码示例]
[another update, code sample]
这里是应用于我的div标签的CSS: / p>
Here's the CSS applied to my div tag:
.user-info{
margin-top: 20px;
margin-right: 20px;
padding: 10px;
background-image: url("../img/user_panel_bg.png");
float:right;
border: 1px #AAAAAA solid;
font-size:12px;
}
推荐答案
div?如果有图片,IE 6中有一个错误,可能会导致div中的空格在底部创建额外的填充
Is there an image in your div? If there's an image, there's a bug in IE 6 that can cause white space within the div to create extra padding on the bottom
额外的填充显示
<div>
<img src="myimage.jpg">
</div>
当您将HTML更改为
<div><img src="myimage.jpg"></div>
这篇关于IE6额外填充底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!