使用浮动既可以清除行内快间隙
<style>
.search{
float: left;
width: 412px;
height: 42px;
background-color: skyblue;
margin-left: 50px;
}
.search input{
float: left;
width: 345px;
height: 40px;
border: 1px solid skyblue;
border-right: 0;
color: #bfbfbf;
font-size: 14px;
padding-left: 15px;
}
.search button{
float: left;
width: 50px;
height: 42px;
border: 0;
background: url('./images/btn.png');
}
</style>
<div class="search">
<input type="text" value="输入关键词">
<button></button>
</div>