淘宝页头怎么添加搜索框?
3个回答
展开全部
<body>
<script>
function test(){
//搜索验证
if(document.so.key.value == ''){
alert("请输入关键词");
return false;
}
return true;
}
</script>
<div id="search" >
<form method="get" action="" name="so" id="凳激so" onsubmit="return test();">
<div id="search2">
<span class="label">搜宝贝</span>
<input type="text" name="key" id="key" />
<input type="氏粗册submit" id="search-submit" value="搜索" />
<歼宏/div>
</form>
</div>
</body>
css:
<style>
#search {
float: center;
width: 520px;
height: 80px;
border:1px solid green;
}
#search-text {
width: 170px;
padding: 6px 5px 2px 5px;
border: 1px solid #DEDEDE;
background: #FFFFFF;
text-transform: lowercase;
font: normal 11px Arial, Helvetica, sans-serif;
color: #5D781D;
}
#search-submit {
width: 80px;
height: 22px;
border: none;
line-height: 22px;
text-align: center;
}
.label {
background: none repeat scroll 0 0 #F6F6F6;
border-right: 1px solid #EFEFEF;
float: left;
height: 22px;
line-height: 22px;
text-align: center;
width: 75px;
}
#search2 {
width: 320px;
height: 22px;
border: 4px solid orange;
margin-top: 25px;
position: relative;
}
</style>
<script>
function test(){
//搜索验证
if(document.so.key.value == ''){
alert("请输入关键词");
return false;
}
return true;
}
</script>
<div id="search" >
<form method="get" action="" name="so" id="凳激so" onsubmit="return test();">
<div id="search2">
<span class="label">搜宝贝</span>
<input type="text" name="key" id="key" />
<input type="氏粗册submit" id="search-submit" value="搜索" />
<歼宏/div>
</form>
</div>
</body>
css:
<style>
#search {
float: center;
width: 520px;
height: 80px;
border:1px solid green;
}
#search-text {
width: 170px;
padding: 6px 5px 2px 5px;
border: 1px solid #DEDEDE;
background: #FFFFFF;
text-transform: lowercase;
font: normal 11px Arial, Helvetica, sans-serif;
color: #5D781D;
}
#search-submit {
width: 80px;
height: 22px;
border: none;
line-height: 22px;
text-align: center;
}
.label {
background: none repeat scroll 0 0 #F6F6F6;
border-right: 1px solid #EFEFEF;
float: left;
height: 22px;
line-height: 22px;
text-align: center;
width: 75px;
}
#search2 {
width: 320px;
height: 22px;
border: 4px solid orange;
margin-top: 25px;
position: relative;
}
</style>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询