最终搜索框如下
步骤:
jsp文件:
<div class="choice">
<input type="text" placeholder="请输入关键字" value="${kw }" id="kw"/>
<input type="button" value="搜索" id="search-btn"/>
</div>
CSS文件:
#choice{
padding:10px ;
width:380px;
margin:30px auto;
font-family:"Microsoft Yahei", "微软雅黑";
font-size:14px;
}
#choice>input{
margin-right:10px;
height:30px;
width:225px;
border:1px solid #e2e2e2;
padding:0 0 0 40px;
}
#choice>input[type='button']{
text-align: center;
border:none;
background:black;
color:white;
height:32px;
width:70px;
padding:5px 10px;
border-radius: 2px;
cursor: pointer;
float:right;
}