Skip to content

Instantly share code, notes, and snippets.

@trey
Created December 3, 2010 00:47
Show Gist options
  • Save trey/726389 to your computer and use it in GitHub Desktop.
Save trey/726389 to your computer and use it in GitHub Desktop.
Some nice basic text input and textarea styling
input[type=text],
textarea { padding: 7px 5px 7px 8px; border: 1px solid #999; }
input[type=text]:focus,
textarea:focus { border-color: #000; border-color: #000; border-width: 1px; border-left-width: 3px; padding-left: 6px; }
input[type=text] { width: 300px; }
input.error,
input.error:focus,
textarea.error,
textarea.error:focus { border-color: red; }
label { display: block; margin: 10px 0 0; font-weight: bold; font-size: 13px;}
p.description { font-size: 11px; color: #888; }
<form action="#" method="post">
<ul>
<li>
<label for="name">Name</label>
<p class="description">What do they call you?</p>
<input class="required" type="text" name="name" value="" id="name">
</li>
</ul>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment