0

使用 IE 8,我的搜索表单无法正确显示。输入字段太低。在 Firefox、Chrome 和 Safari 中,一切正常。

IE 8 中的搜索表单

Chromium 中的搜索表单

这是我的 HTML:

<form class="search" role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
<input type="text" placeholder="Suchen..." name="s" id="s" />
<input type="submit" id="searchsubmit" value="Start" />
</form>

这是我的 CSS:

.search {
background: #F3F4F3;
padding: 10px;
width: auto;
color: #666;
font-size: 11px;
line-height: 1.3em;
padding-top: 10px;
margin-bottom: 20px;
margin-top: 0px;

}

input {
color:#fff;
border:1px solid #B3B5B3;
background:transparent;
outline:none;
height:21px;
padding:0;
margin: 0;
padding: 0px 8px;
font-family: $std-sans-font;

}

input[type="text"] {
color: #515b57;

}

:-moz-placeholder {
color:#515b57;

}

::-webkit-input-placeholder {
color:#515b57;

}

input:focus {
font-style: normal;
@include single-box-shadow(rgba(255,255,255,0.5), 0px, 0px, 6px);

}

form {
display:inline-block;

}

input[type="submit"] {
background:#B3B5B3;
height:23px;
border:0;
&:hover, &:focus {
    @include single-box-shadow(rgba(255,255,255,0.5), 0px, 0px, 6px);
}

}

也许,填充有问题?

4

2 回答 2

0

你只是错过了float property所以用这个波纹管编辑你的CSS

input[type="text"] {
   color: #515b57;
   margin-right: 2px;
   float: left;
}

input[type="submit"] {
background:#B3B5B3;
height:23px;
float: left;
&:hover, &:focus {
    @include single-box-shadow(rgba(255,255,255,0.5), 0px, 0px, 6px);
}​

input::-moz-focus-inner
{
    border: 0;
    padding: 0;
}

它应该工作。在 jsfiddle 上 看到它。input::-moz-focus-inner输入正确text-align

于 2012-06-02T14:41:25.660 回答
0

试试这个 css,我已经从输入中删除了 padding:0

.search { 
background: #F3F4F3; 
padding: 10px; 
width: auto; 
color: #666; 
font-size: 11px; 
line-height: 1.3em; 
padding-top: 10px; 
margin-bottom: 20px; 
margin-top: 0px; 

 }
input { 
color:#fff; 
border:1px solid #B3B5B3; 
background:transparent; 
outline:none; 
height:21px;  
margin: 0; 
padding: 0px 8px; 
font-family: $std-sans-font; 

 }
input[type="text"] { 
color: #515b57; 

 }
:-moz-placeholder { 
color:#515b57; 

 }
::-webkit-input-placeholder { 
color:#515b57; 

 }
input:focus { 
font-style: normal; 
@include single-box-shadow(rgba(255,255,255,0.5), 0px, 0px, 6px); 

 }
form { 
display:inline-block; 

 }
input[type="submit"] { 
background:#B3B5B3; 
height:23px; 
border:0; 
&:hover, &:focus { 
    @include single-box-shadow(rgba(255,255,255,0.5), 0px, 0px, 6px); 
} 
于 2012-06-02T14:18:01.637 回答