Reputation: 93
I want to change the color of the parent and the sub parent category into two different colours. Currently using the following code for my widget side tab.
.widget ul {background: gray;padding-top: 1px;}
.widget ul li {background:lightgray;margin: 1px;}
.widget ul a{background-color:darkgray;padding:1px;}
looking to change the font colour. I have tried many options but still not getting it right.
Upvotes: 1
Views: 83
Reputation: 6158
Try this:
.widget ul li.parent > a {
color: red !important;
}
Upvotes: 2
Reputation: 79
It's hard to say without seeing your HTML structure, but are each of the sub-parent links ('Access Control', 'Electronic locks', etc) their own ul
tags?
If so, could you not target each of their first li
's like this:
.widget ul > li:first-of-type > a {
color: red;
/* INSERT STYLES */
}
This would target all ul
s' first li > a
elements, as in the image on the right.
Upvotes: 1