I installed a WP theme (Make, though that shouldn't matter for the question), and I set the Header Bar text to black colour through the theme options. I want to make one particular item in the Header Bar menu to have a different colour (to stand out), so I added a css class named "appt-nav" to that menu item to be able to manipulate it separately.
Then, I added some custom code in the them stylesheet through Dashboard > Appearance > Editor, but it has no effect on the text colour. If I try to apply some other styles for the class, they work, so I'm guessing the font colour is overriden by something in the theme.
For example, if I use
.appt-nav {
color: red;
text-decoration: line-through;
}
the line through the text does appear, it's coloured red, but the text itself is still black.
I tried inspecting the generated HTML, but I couldn't figure out why this is happening. Also, using appt-nav a
(because the actual text is in an a element) didn't help.
- How can I figure out what exactly is overriding the text colour?
- How can I fix it while still following good practices?
.appt-nav a
could be overwrite byheader .main-nav li a
or something like this. Also, maybe you are editing the defaultstyle.css
file and the theme load an other style after so your code is overwrite. Without seeing your source code, it is the only way I have to guide you.header .main-nav li.appt-nav1
.color
and that will show you which style is providing the style. You then need to copy that entire style definition and add your class name in to override it. Eg, if the style isnav ul li a
then yours needs to benav ul li.appt-nav a