One aspect of web development I’ve always loathed was working with forms. Form elements have traditionally been difficult to style due to OS and browser differences, and validation can be a nightmare. Luckily the native HTML APIs added methods for improving the form validation situation.
input[type=number] elements, you can add
max attributes. Those attributes are great but the browser doesn’t display distinct error styles if those numbers are out of range. Luckily we have
/* matches when number is not within min and max */ input[type=number]:out-of-range border-color: red;
Thanks to CSS
:out-of-rangedevelopers can style
The post CSS: out-of-range appeared first on David Walsh Blog.