我在Chrome瀏覽器中無法正確顯示的文本框和按鈕的位置存在問題。Chrome瀏覽器下的CSS問題(文本框和按鈕)
下面是來自每個瀏覽器的示例,您可以看到Chrome下的文本框被推出了位置。
的Internet Explorer/Firefox的
鉻
HTML:
<div id="divSearch">
<input type="text" id="txtSearch" placeholder=" Search..."/>
<input type="submit" id="btnSearch" value=""/>
</div>`
CSS:
input[type=text]{
width: 200px;
height: 24px;
border: none;
border-radius: 3px 0px 0px 3px;
-webkit-border-radius: 3px 0px 0px 3px;
-webkit-appearance: none;
-moz-appearance: none;
padding: 0;
}
input[type="submit"]{
border: none;
border-radius: 0px 3px 3px 0px;
-webkit-appearance: none;
-moz-appearance: none;
-webkit-border-radius: 0px 3px 3px 0px;
width: 32px;
height: 24px;
background: url(../img/search_button.png) no-repeat;
background-color: white;
background-position: 10px 5px;
}
#divSearch{
float: right;
width: 300px;
height: 40px;
white-space: nowrap;
margin-right: 50px;
}
現在,如果我從input[type="submit"]
刪除高度的位置是正常的,除了按鈕現在是錯誤的大小。
我想不通,爲什麼按鈕的高度引起的問題。有關如何解決它的任何建議?
謝謝
[HTML輸入按鈕css-height在Safari和Chrome上無法正常工作]的可能副本(http://stackoverflow.com/questions/12450776/html-input-button-css-height-not-working-on-safari - 鉻) –