搜索框与搜索按钮并排——无缝对接


1、效果图

  难点在于搜索框与搜索按钮要无缝对接

2、实现

  (1)搜索框的高度(height+上下border)==搜索按钮的高度

  (2)搜索框的字体大小、样式==搜索按钮中的字体大小、样式

  (3)搜索框和搜索按钮都要去掉边框:outline:none;当然 搜索按钮需要再加上一个border:none;

3、代码

 html代码: 

<div class="search">
      <input type="text" id="in" value="图书开抢" /><button class="btn_search">搜索</button>
 </div>
View Code

 css代码:

.search #in{
    width:454px;
    height:30px;
    border:2px solid red;
    outline:none;
    font:14px/30px "microsoft yahei";
}
.search .btn_search{
    background:red;
    width:80px;
    height:34px;
    color:white;
    border:none;
    outline:none;
    font:14px/34px "microsoft yahei";
}
View Code

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM