Blue Hippo
KPCKevin Powell - Community
•Created by Blue Hippo on 6/29/2023 in #front-end
Default required input styling
Hey everyone, I'm trying to style an required input differently based on if it's in its default state, versus when a user either gives an invalid input or tries to submit the form before giving a valid input. I thought I could use the :user-invalid pseudo selector mentioned on MDN but only firefox and Safari support it at the moment. Using a combination of :required, :blank and :invalid also won't work because no one supports :blank. Any ideas?
TLDR: I don't required inputs to be automatically invalid and red when loaded and need help changing that.
4 replies