Possible Duplicate:
What does “>” mean in CSS rules?
CSS has the following two syntaxes which seem to be doing the same thing. Selecting a nested element.
div span
div > span
Am I missing something, or are these two indeed equivalent selectors ?
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.
No, they are not equivalent. The first one is the descendant selector, while the second is the child selector.
Quick example:
With this markup
.a > .cwill select nothing, while.a .cand.a > .b > .cwill select the innermost element.