I was doing some css today and was forced to change some syntax from:
input.cssClass
to
.cssClass input
How do these definitions differ, and when should we use either of them?
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.
Wow, that is an odd change. The first will collect all the
inputswith classcssClass, while the second will take allinputsinside any element withcssClass.So here, the first input will be grabbed by your first selector, while the second input will be grabbed by your second selector. Neither selector will grab both.