How to create an Animated Search Form

How to create an animated search form..

Demo↓

Animated Search Form

 

Add Html:

<form>
  <input type="text" name="search" placeholder="Search..">
</form>

Add CSS:

input[type=text] {
  width: 130px;
  box-sizing: border-box;
  border: 2px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
  background-color: white;
  padding: 12px 20px 12px 40px;
  -webkit-transition: width 0.4s ease-in-out;
  transition: width 0.4s ease-in-out;
}
input[type=text]:focus {
  width: 100%;
}

Be the first to comment

Leave a Reply

Your email address will not be published.


*