Improve your forms with a couple lines of CSS

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

ShortIntermediateUI1 min

About this video

A short CSS tutorial showing how to use the :user-valid and :user-invalid pseudo-classes to style form fields only after a user has interacted with them, with a fallback selector for browsers without support.

What you’ll learn

  • Style form fields with :user-valid and :user-invalid