<body>
<form class="search" action="" method="post">
<label for="search-box">Search:</label>
<input id="search-box" type="text" name="search" maxlength="50">
</form>
</body>
body{
background-color: #876;
}
.search label{
font-size: 0.75em;
font-weight: bold;
color: #333;
text-indent: -9999em;
display: block;
float: left;
}
.search input[type="text"]{
text-indent: 1px;
padding: 3px 0 3px 22px;
width: 5px;
height: 22px;
background-color: #333;
background: url(http://www.ian-thomas.net/examples/search-icon.png)2px 2px no-repeat, -webkit-linear-gradient(top, rgba(100,100,100,1) 0%,rgba(80,80,80,1) 10%,rgba(22,22,22,1)100%);
color:#999;
line-height: 20px;
font-weight: bold;
-webkit-text-shadow: 1px 1px 1pxrgba(0,0,0,0.05);
text-shadow: 1px 1px 1pxrgba(0,0,0,0.05);
-webkit-border-radius: 6px;
-webkit-box-shadow: 1px 1px 0rgba(0,0,0,0.125);
-webkit-transition: width 0.5s ease-in-out;
-moz-transition: width 0.5s ease-in-out;
transition: width 0.5s ease-in-out;
cursor: pointer;
}
.search input[type="text"]:focus{
width: 250px;
outline: none;
background:url(http://www.ian-thomas.net/examples/search-icon.png)2px 2px no-repeat, -webkit-linear-gradient(bottom,rgba(100,100,100,1) 0%, rgba(40,40,40,1) 2%, rgba(22,22,22,1)100%);
-webkit-box-shadow:1px 1px 0 rgba(255,255,255,0.125);
-webkit-transition: width 0.5s ease-in-out;
-moz-transition: width 0.5s ease-in-out;
transition: width 0.5s ease-in-out;
cursor:text;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.