În CSS punem:
Cod
.search_block *{margin:0;padding:0;}
.search_block{position:relative;width:263px;display: inline-block;}
.search_block input[type="text"]{-moz-transition: all 0.4s linear; -o-transition: all 0.4s linear; -webkit-transition: all 0.4s linear;border-radius: 3px;padding: 6px 6px;display:inline-block;width: 110px;height:16px;outline:0;float:right;border: 1px solid #9e624d;}
.search_block input[type="text"]:focus{width: 220px;box-shadow:0 0 6px #07a4d1 ;border:1px solid #1cacd6;}
.search_block input[type="submit"]{border-radius:3px;outline:none;right: 6px;top:5px;float:right;position:absolute;width:20px;height:20px;border:0;background: url('http://webo4ka.ru/Ucoz8/Search-Find.png') center center no-repeat;}
Unde vrem să apară forma de căutare:
Cod
<?if($SEARCH_FORM$)?>
<div class="search_block">
<form onsubmit="this.sfSbm.disabled=true" method="get" style="margin:0" action="/search/">
<input type="text" name="q" required placeholder="Căutare..." maxlength="70" size="20" />
<input type="submit" name="sfSbm" value="" />
</form>
</div>
Rezultat:
Înainte de clic:
După clic:
Sursă: Webo4ka.ru