CSS Style form elements ( valid and invalid pseudo classes )

preview_player
Показать описание
Optional fields with empty values are valid by default. Obviously, if user input satisfies the constraints of the field, it exists in a valid state.
Рекомендации по теме
Комментарии
Автор

Form controls can have multiple states at once. So you may find yourself managing specificity and cascade conflicts. A way to mitigate this is by limiting which pseudo-classes you use in your projects. For example, don’t bother defining an :optional rule set if you’ll also define a :valid rule set.

dailydeveloper