Whats the difference between these two selectors, I thought they would have the same effect, but they don’t? can someone explain please?
#parent-div #child-div
#parent-div#child-div
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.
The (space) in CSS selectors is the “descendant selector.”
child-divthat has an ancestor ofparent-divparent-divandchild-div(which is impossible)Just for fun:
parent-div#child-divis a valid ID, but as part of the CSS syntax you have to escape the#in the ruleset:http://jsfiddle.net/ExplosionPIlls/xdWNV/1/