您好,欢迎来到海亿美食网。
搜索
您的当前位置:首页css制作好看的搜索框

css制作好看的搜索框

来源:海亿美食网
 做网站开发我们肯定少不了一种最基本的功能,就是搜索框,那么搜索框样式也能让一个网站看起来更加美观上档次。现在我们就教大家一种如何把搜索框做的很美观的方法。

效果图:

实现这种效果有两种方法:一是整体处理一个背景,以透明gif图的方式定位到搜索框,或者切分开,这种方法加载快,而且灵活性更高。
文中用到的图片


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
<title>CSS美化的漂亮搜索框</title> 
<style type="text/css"> 
body{ font: normal 100% 'Arial','Helvetica','Verdana',sans-serif; color: #333; } 
p { padding: 12px 0; margin: 0; font-size: .8em; line-height: 1.5; } 
form { margin: 0; } #search_box 
{ width: 201px; height: 31px; background: url(http://files.jb51.net/demoimg/200912/bg_search_box.gif); } #search_box #s 
{ float: left; padding: 0; margin: 6px 0 0 6px; border: 0; width: 159px; background: none; font-size: .8em; } 
#search_box #go { float: right; margin: 3px 4px 0 0; } </style> </head> <body> <div id="search_box"> 
 <form id="search_form" method="post" action="#"> <input type="text" id="s" value="Search" /> 
 <input type="image" src="http://files.jb51.net/demoimg/200912/btn_search_box.gif" width="27" height="24" id="go" alt="Search" title="Search" /> 
 </form> 
 </div> 
 </body> 
 </html>

提示:您可以先修改部分代码再运行

Copyright © 2019- hyl365.com 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务