:required
is a state based pseudo class that can be useful when styling forms.
Combined with :valid
and :invalid
we can have a lot of control over providing visual feedback to users without having to write lots of JavaScript.
In this episode we’ll learn:
- How to use HTML5 form validation
- Using
:required
and other state-based pseudo classes - A creative technique for displaying validation messages to users
HTML5 Validation
When asking a user to fill out a form, it’s very common to have certain mandatory fields. These might be for their name, email address or credit card details.
In HTML5 we can leverage client-side validation without JavaScript when the behaviour is built into modern browsers.
Continue reading %AtoZ CSS Screencast: The Required Pseudo Class%
by Guy Routledge via SitePoint
No comments:
Post a Comment