HTML
<div class="cont-search">
<input type="text" class="in-search" placeholder="本站搜索" /> <input type="button" class="in-btn" value="" />
</div>
CSS
.cont-logo{
float: left;
}
.cont-search{float: right; background: red;}
.in-search{
height:29px; width: 365px;
float: right;
}
.in-btn{
height: 35px; width: 66px; background-image: url(images/1_07.jpg); float: right; border: none;
}
两个同级别元素同时右浮动,排在上面会浮在更右,你把两个的html顺序换一下就好。
一周热门 更多>