I am going to share simple css search box design with html & css code. Its looks like window metro style search box.
CSS Code
#search input {
background: none repeat scroll 0 0 #fff;
border: 0 none;
color: #7F7F7F;
float: left;
font: 12px 'Helvetica','Lucida Sans Unicode','Lucida Grande',sans-serif;
height: 20px;
margin: 0;
padding: 10px;
transition: background 0.3s ease-in-out 0s;
width: 300px;
}
#search button {
background: url("search.png") no-repeat scroll center center #7eac10;
cursor: pointer;
height: 40px;
text-indent: -99999em;
transition: background 0.3s ease-in-out 0s;
width: 40px;
border: 2px solid #fff;
}
#search button:hover {
background-color:#000;
}
Html Usage
[php] <form method="get" id="search" action="http://w3lessons.info/"><input type="text" class="search" value="Type and hit enter" onblur="if(this.value == ”) { this.value = ‘Type and hit enter’; }" onfocus="if(this.value == ‘Type and hit enter’) { this.value = ”; }" name="s">
<button type="submit">Submit</button>
</form>
[/php]
Please donβt forget to share and subscribe to latest updates of the blog.
Thanks!
Thanks. Looks good. π
Thanks. Looks good. π
Thanks for this looks good in Chrome. IE resizes the box that contains the image for some reason when you click in the input field, but still usable. Thanks again.
Thanks Bro π
Hi,
Can you pass me down the code ! I m not getting the search.png file !
Hi Subhohit,
Download it from here – http://w3lessons.info/demo/windows-8-search-box/search.png