Better Invalid Input Selectors

(thanks @joao6246 invalid input in CSS state/selector)
input:not(:placeholder-shown):invalid {
  /*   styles here only apply *after* the user has entered data */
  /* rather than immediately after the input is selected        */
}


https://css-tricks.com/form-validation-ux-html-css/#aa-sub-trick-testing-if-an-input-has-a-value-or-not
CSS-TricksChris Coyier
You can do an impressive amount of form validation with just HTML attributes. You can make the user experience pretty clean and clear with CSS selectors. But
Form Validation UX in HTML and CSS | CSS-Tricks
Was this page helpful?