Skip to content

Instantly share code, notes, and snippets.

@steweir
Created June 4, 2013 12:10
Show Gist options
  • Select an option

  • Save steweir/5705456 to your computer and use it in GitHub Desktop.

Select an option

Save steweir/5705456 to your computer and use it in GitHub Desktop.
Responsive search box
.f { position: relative; }
.is-vishidden {
position: absolute;
overflow: hidden;
width: 1px;
height: 20px;
padding: 0;
border: 0;
clip: rect(1px, 1px, 1px, 1px);
}
.pattern {
padding: 1em;
margin-top: 50px;
}
input {
display: block;
border: 1px solid #ccc;
&[type=search] {
width: 100%;
height: 3.2em;
padding: 1em;
padding-right: 7em;
position: relative;
top: 0;
border-radius: 4px;
moz-border-radius: 4px;
webkit-border-radius: 4px;
}
&[type=submit] {
position: absolute;
right: 0.75em;
top: 0.5em;
bottom: 0.5em;
z-index: 1;
width: 6em;
padding: 0;
cursor: pointer;
background: #e0e0e0;
border-radius: 4px;
moz-border-radius: 4px;
webkit-border-radius: 4px;
&:hover {background: #ccc;}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment