Hi everyone, I checked everywhere via F12 but I couldn’t find it.
How can I change the text color?
When searching, the text is white. I want to change the color before searching.
Hi everyone, I checked everywhere via F12 but I couldn’t find it.
How can I change the text color?
When searching, the text is white. I want to change the color before searching.
That would be the placeholder text for the input. You can target that using ::placeholder
pseudo element in your CSS.
I’m glad you got it working! Just a heads up, the code snippet you provided actually targets all input fields on the entire site and updates their placeholder text color.
Perhaps that might not be your intention and thus it may be good to add some specificity to your selector.
For example, if you are aiming to target the search input in the search menu only, you can do something like this:
.search-menu #search-term::placeholder {
color: #hexcode;
}
Yes, I first tried it as you wrote, but I wrote it differently. When I got an error, I just wrote the placeholder code and ran it. Thank you for your interest.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.