Skip to content

Instantly share code, notes, and snippets.

@joeyred
Created September 13, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeyred/a4f0d228ed460643bd0e to your computer and use it in GitHub Desktop.
Save joeyred/a4f0d228ed460643bd0e to your computer and use it in GitHub Desktop.
Expandable Search Field
<div class="top-bar">
<div class="left">
</div>
<div class="right">
<form class="search-form">
<input type="text" name="search" placeholder="Search" />
</form>
</div>
</div>
.top-bar {
background: lightblue;
padding: 0.4rem;
}
.top-bar:before {
content: "";
display: table;
}
.top-bar:after {
content: "";
display: table;
clear:both;
}
.search-form {
float: right;
}
.search-form input[name="search"] {
border-radius: 0.3rem;
border: 1px solid #aaa;
padding: 0.5rem 0.4rem;
font-size: 1.1rem;
width: 180px;
transition: width 0.3s ease-in-out;
}
.search-form input[name="search"]:focus {
width: 300px;
outline: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment