Skip to content

Instantly share code, notes, and snippets.

@desbest
Last active October 19, 2017 13:58
Show Gist options
  • Save desbest/4b7cfddabf8040aa2ea059357cf2f9be to your computer and use it in GitHub Desktop.
Save desbest/4b7cfddabf8040aa2ea059357cf2f9be to your computer and use it in GitHub Desktop.
Different ways of displaying errors in validation
/*
Text Errors for validation
*/
label { width: 10em; float: left; }
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
p { clear: both; }
.submit { margin-left: 12em; }
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
.required { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 24px;
margin-right: 6px;
background-color: #CCCCCC;
border: 1px solid #666666;
}
/*
Visual Errors for validation
*/
/* Validation */
label.error { visibility: hidden; }
input.error, textarea.error, select.error { border-bottom: 3px solid #cc0000; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment