A Pen by Captain Anonymous on CodePen.
Created
December 17, 2014 18:59
-
-
Save nickmealey/2f9391f5738cc80740bf to your computer and use it in GitHub Desktop.
XJKpRV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="#" class="search-form"> | |
<label class="search" for="search-term"> | |
<input type="text" id="search-term" name="q" placeholder="Search..."> | |
<img src="http://s11.postimg.org/6o8p91g1b/search.png?noCache=1418841941" class="search-icon" alt="Search"> | |
</label> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.search:before { | |
content: ''; | |
display: inline-block; | |
height: 100%; | |
vertical-align: middle; | |
} | |
.search { | |
display: inline-block; | |
background: #333; | |
min-width: 60px; | |
height: 60px; | |
border-radius: 30px; | |
text-align: center; | |
cursor: pointer; | |
} | |
#search-term { | |
width: 0; | |
padding: 0; | |
border-width: 0; | |
background: none; | |
color: white; | |
margin: 0 20px 0 0; | |
font-size: 16px; | |
vertical-align: center; | |
outline: none; | |
transition: all 0.1s ease-out; | |
} | |
#search-term:focus { | |
padding: 0 20px; | |
width: 250px; | |
transition: all 0.1s ease-out; | |
} | |
.search-icon { | |
vertical-align: middle; | |
position: relative; | |
left: -15px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment