css - 在 IE7 中消失的提交按钮

标签 css button internet-explorer-7 submit

问候。我在使用以下遗留代码时遇到问题。除了 IE7 之外,一切都很好,提交按钮消失了。页面上仍然留有空间,但没有显示。我尝试了各种强制 hasLayout 的方法,但没有成功。有什么建议吗?

XHTML(XHTML 1.0 严格 DOCTYPE):

<div id="headerFunctionality" class="clearfix">
<div id="headerSearch" class="clearfix">
<form action="http://foo.com" method="GET">
<label for="q">Search</label>
<input id="q" name="q" type="text" class="text" />
<input type="submit" id="btn_search" value="Search">
</form>
</div>
</div>

CSS:

#headerFunctionality {
    float: right;
    display: inline;
    margin: 24px 14px 25px 0; 
}

#headerSearch{
    float: left;
    margin-left: 20px;
    width: auto;
}

#headerSearch label{
    position: absolute;
    top: -5em;
    color: #FFF;
}

#headerSearch input.text{
    width: 133px;
    height: 18px;
    border: 1px solid #999;
    font-size: 0.69em;
    padding: 2px 3px 0;
    margin: 0 6px 0 0;
    float: left;
}

/* Replace search button with image*/
input#btn_search {
    width: 65px;
    height: 20px;
    padding: 20px 0 0 0;
    margin: 1px 0 0 0;
    border: 0;
    background: transparent url(../images/btn.search.gif) no-repeat center top;
    overflow: hidden;
    cursor: pointer; /* hand-shaped cursor */
    cursor: hand; /* for IE 5.x */
}
form>input#btn_search { /* For non-IE browsers*/
    height: 0px;
}

input#btn_search:focus, input#btn_search:hover {

background: transparent url(../images/btn.search.over.gif) no-repeat center top;

最佳答案

您确定 display:block 已添加到输入的 css 中吗?这应该可以解决问题。

关于css - 在 IE7 中消失的提交按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1646916/

相关文章:

html - 模态高度和宽度调整

jquery - 温度天气颜色变化

android - 具有两个按钮的 ListView 行中的 OnClick 事件

javascript - 使用 javascript 中的第 n 个子项指定图像在放置区域的位置

javascript - 如何通过setInterval设置div元素的图片背景?

html - IE6 和 IE7 不能正确处理具有高度属性的元素的边距

CSS - IE 7 z-index 问题

css - IE7 Z-Index 问题

wpf - 扩展 WPF 按钮以在新属性中存储数据

html - 悬停时按钮动画以从上到下更改颜色