0

I have this html:

 <li class="arrow branches"></li>
 <li class="arrow branches"></li>
 <li class="arrow branches"></li>

 <li class="arrow"></li>
 <li class="arrow"></li>
 <li class="arrow"></li>

I want to give css commands only for "arrow branches" classes,how can I give them css that wont effect the "arrow" classes?

3 Answers 3

4

Create the class .branches:

.branches{
    color:#f00;
}

If you want to apply it to only those elements that have branches and arrows then put them together:

.arrow.branches{
    color:#f00;
}

But if you want to apply it to more than one class thats easy too:

.branches, .otherClass{
    color:#f00;
}
Sign up to request clarification or add additional context in comments.

2 Comments

but I want css to point to the arrow of the branches only,and not to effect the arrow,I also want not to approach only branches
I updated my question. The .branches and .arrow are given to the same three elements, what are you expecting to happen?
2

It's extremely simple:

li.arrow.branches
{...styles...}

This selects LI elements with the classes branches AND arrow, but not arrow on its own.

Comments

0
.arrow.branches { // your css }

Works only for elements with both classes.

Comments

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.