简介:当我们做搜索时,经常会看到带有搜索按钮的背景,这里我做成了模块,以后用的时候,直接复制过来就可以用了。
HTML代码:
<div class="head02" id=""> <table class=""> <form name="formsearch" action="#"></form> <input name="kwtype" value="0" type="hidden"> <tr> <td><input name="q" class="search-keyword" id="search-keyword" value="" onfocus="if(this.value=='站内搜索...'){this.value='';}" onblur="if(this.value==''){this.value='站内搜索...';}" type="text"></td> <td><img alt="提交" src="images/search.gif" width="64" height="30" onclick="document.formsearch.submit();" class="searchimg"></td> </tr> </table> </div>
CSS代码:
.head02{float:left;width:308px;height:36px;background: url("../images/search.jpg") no-repeat transparent; overflow:hidden; } .search-keyword{height:24px; line-height:24px; border:0px solid; width:225px;margin-left:2px;color:#cbcbcb;padding-left:10px;} .searchimg{cursor:pointer;}
这里用到的图片,请下载案例进行复制吧。