首先,請看右側搜索位置,試試先!!(若是你用的是IE,悲劇了)php
小小的動畫,是css3實現的,頗有愛,有木有!!css
代碼以下:css3
.searchdemo {display:inline-block;position:relative;height:27px;margin:60px;}.searchdemo:hover {-webkit-box-shadow:0 0 3px #999;-moz-box-shadow:0 0 3px #999}.searchdemo .sinput {float:left;width:130px;height:19px;line-height:19px;padding:3px 5px;border:#A7A7A7 1px solid;background:white;color:#888;font-size:12px;-webkit-transition:.3s;-moz-transition:.3s;outline: none;}.searchdemo .sinput:focus {width:200px;}.searchdemo .sbtn {cursor:pointer;height:27px;font-size:12px;float:left;width:50px;margin-left:-1px;background:#eee;display:inline-block;padding:0 12px;vertical-align:middle;border:#A7A7A7 1px solid;color:#666;}.searchdemo .sbtn:hover {background:#ddd;}
<form action="/index.php" method="get"><input type="text" name="s" /> <input type="submit" value="搜索" /></form>
效果看本站搜索部分!!web