如何使用internet explorer的css参数修复提交按钮?

如何使用internet explorer的css参数修复提交按钮?,css,Css,我的网站在chrome nad firefox上运行良好,但在InternetExplorer11上似乎没有正确显示提交按钮 有人能检查一下出了什么问题吗 这是按钮的style.css代码: #searchsubmit { font-family: Frutiger, Lato; background: url('images/search.png'); cursor: pointer; width: 30px; height: 30px; border: 0px; float

我的网站在chrome nad firefox上运行良好,但在InternetExplorer11上似乎没有正确显示提交按钮

有人能检查一下出了什么问题吗

这是按钮的style.css代码:

#searchsubmit { 
 font-family: Frutiger, Lato;
 background: url('images/search.png');
 cursor: pointer;
 width: 30px;
 height: 30px;
 border: 0px;
 float:right; 
 margin-top:5px;
}

.searchform input, .searchform input#s, placeholder { 
 font-family: Frutiger, Lato;
 background: #4D6B87;
 height: 30px;
 border: 0px;
 color: #EAEAEA;
 font-size: 14px;
 padding-left: 5px; 
}

所有style.css都可以在这里找到:www.virmodrosti.com/wp content/themes/virmodrosti/style.css

第一个解决方案:

我找到了一种方法,但您必须使用Internet Explorer的条件注释,这将解决您的问题,请这样做:

<!--[if IE]>
<style>
    #searchsubmit {
         position:absolute;
         right:20px;
    }
</style>
<![endif]-->


第二种解决方案:

我不确定这一点,因为我不再使用internet explorer,所以无法对其进行测试,但如果您简单地添加:

<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

它将仅在Internet Explorer 11上模拟为edge,但您必须尝试。

尝试以下代码:

.searchform#searchform input, .searchform#searchform button {
    display: inline-block;
    float: none;
    vertical-align: middle;
    margin: 0;
}
.searchform#searchform input {
    width: calc( 100% - 40px );
    margin-right: -2px;
}
.searchform#searchform button {
    width: 30px;
    margin-left: -2px;
}

这是不是因为这个条目*{padding:0;margin:0;}而IE可能没有正确地识别出来?