How do I query for an element that have two classes at the same time?
For example:
<div><span class='major minor'>Test</span></div>
I want to style all the spans that have ‘major’ and ‘minor’ classes at the same time.
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 following should do the trick:
Note you have to be careful with this with Internet Explorer 6 – it will only read the last class of the selector. For example, it will incorrectly apply the rule above to the following: