为什么我的div中会出现额外的填充?

时间:2012-06-07 23:50:01

标签: css internet-explorer

我为所有浏览器编码了我的网站,但当然IE有问题。特别是只有IE 7.我希望找到一个解决方案,解决为什么它的行为方式与两个问题和我可以添加的内容,以便IE将正确显示它。

我的提交按钮与其包含div的底部对齐。

enter image description here

SEARCH字段的SUBMIT按钮的CSS

#searchform { /*container widget */ position: relative; left: 15px; width: 97%; height: 30px; background-color: #f3f3f3; border: 2px solid #742222;}

#searchform label { display: none; }

#searchform input#s { width: 75%; height: 20px;}

input[type=text],input#s { margin: 0 10px 0 0; width: 60%; }

#searchsubmit{ position: relative; float: right; width: 30px; height: 30px; text-indent: -999px; background: url(http://averylawoffice.ca/img/SEARCH-submit.jpg) center; border: 0px;}

这个CSS适用于所有浏览器,但IE版本7.是否有办法使其顶部对齐而不必绝对位置?

1 个答案:

答案 0 :(得分:2)

我已经设法通过左侧浮动文本框来向上移动SUBMIT按钮(到正确的位置)。

.subscription_email {
    ...
    float: left;
}

搜索文本框也是如此:

#s {
    ...
    float: left;
}

通过进行这些更改,生成的演示文稿将与Firefox中的完全相同。

相关问题