Let’s say I want to target a span class element:
If I do like this, it doesn’t have any effect:
ul#sponsors li span .spanelement {
}
But if I do like this:
ul#sponsors li span.spanelement {
}
It’s working. What’s the difference in here?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This one:
matches any element with
class="spanelement", but it must be inside the span (which is inside an li inside a ul with id=”sponsors”).This one:
matches the
<span class="spanelement">itself (provided it’s inside an li inside a ul with id=”sponsors”).