Tagged: background color, field, form, highlight, input
I want to make any form fields that are clicked in have a background/highlight color. I know I can use “:focus” but not sure where to put it. I’d like to cover ALL fields at one time if possible.
For testing only text fields, I used:
#top input[type=”text”]:focus {
background-color: #51CBEE !important;
}
but, for example, not sure what the difference is in “#top .input-text” and “#top input[type=”text”]”
Hmmm, this seems to work but could I be missing anything?
#top input[type=”text”]:focus,
#top input[type=”email”]:focus,
#top input[type=”tel”]:focus,
#top input[type=”number”]:focus,
#top textarea:focus,
#top select:focus {
background-color: #FFFA99 !important;
}
Hi!
Thank you for visiting the support forum.
Did it work for you? You can use this if you want:
#top input[type="text"]:focus, #top input[type="password"]:focus, #top input[type="email"]:focus, #top input[type="number"]:focus, #top input[type="url"]:focus, #top input[type="tel"]:focus, #top input[type="search"]:focus, #top textarea:focus {
box-shadow: 0px 0px 2px 0px rgba(0,0,0,0.2);
color: #555;
background-color: #FFFA99 !important;
}
Regards,
Ismael
Yes it worked. Thanks!