連續input在同一行對齊問題


今天遇到這個問題,我是想達到這個效果:

寫了如下代碼:

<style>
input{
    outline:none;
    margin:0;
    padding:0;
}
#serch_box{
    width:210px;
    height:38px;
    border:1px solid #ccc;
    border-right:none;
}
#serch_btn{
    background:url(index/images/serch_btn.png);
    width:104px;
    height:40px;
    border:none;
}
</style>
</head>

<body>
<input id="serch_box" type="text" />
<input id="serch_btn" type="button" />
</body>

該代碼在FireFox下顯示是這樣:

搜索框和按鈕之間有個間距,怎么也拿不掉。

在chrome下是顯示這樣:

把你們放一塊還若即若離同行不同心是什么意思。

嘗試margin、padding等方法也不能解決竄位的問題。

最后給兩個input加了個浮動,問題解決。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM