1

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.enter image description here

2 Answers 2

2

Try this:

.widget ul li.parent > a {
    color: red !important;
}
Sign up to request clarification or add additional context in comments.

1 Comment

Perfect. Thanks a Tone.
1

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 uls' first li > a elements, as in the image on the right.

1 Comment

www.secsa.co.za. Is the website.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.