Skip to content

Instantly share code, notes, and snippets.

@gdamjan
Created October 21, 2011 14:02
Show Gist options
  • Select an option

  • Save gdamjan/1303934 to your computer and use it in GitHub Desktop.

Select an option

Save gdamjan/1303934 to your computer and use it in GitHub Desktop.
stretch input field to 100%
<html>
<!-- WILL NOT WORK with the HTML5 doctype -->
<div class="text-stretch">
<input />
</div>
</html>
/* hack to stretch an input element */
.text-stretch input { width: 100%; }
.text-stretch { padding: 2px 8px; }
* html .text-stretch { padding: 2px 10px; }
* html .text-stretch input { margin-right: -11px; }
@thefathdev
Copy link
Copy Markdown

Really helpful ✨ Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment