云优cms建站,产品列表需要增加搜索功能,我们今天就来写一下具体的代码
后台搜索模板search_index.html中在搜索位置加上以下代码即可
//搜索框代码
<div class="search">
<div class="container">
<div class="fr">
<form action="<yunu:url name='search'/>" method="post">
<input type="hidden" name="cid" value="4">
<input type="text" name="key" id="input1" value="" placeholder="请输入搜索关键词">
<button type="submit" class="btn"></button>
</form>
</div>
</div>
</div>
//搜索框css代码
.search{height: 70px; border-bottom: 1px solid #e2e2e2;}
.search i{margin-right: 10px; display: inline-block; vertical-align: top; width: 17px; height: 68px; background: url(../images/daohangdw.png) no-repeat center;}
.search .fl{line-height: 70px; float: left; display: inline;}
.search .fl span{color:#333; font-weight: bold;}
.search .fr{width:320px;height: 70px; float: right; display: inline;}
.search .fr input{width: 220px;height: 36px;border: 1px solid #eee;margin-top: 15px;padding-left: 3px; border-radius: 6px 0 0 6px; padding-left: 15px;}
.search .fr button{width:75px;height: 40px;background: url(../images/search.jpg) no-repeat;border: none;position: relative;left: -10px;top:14px;}
前台展现样式
请立即点击咨询我们或拨打咨询热线: 18031152740,我们会详细为你一一解答你心中的疑难。业务经理在线