I have two css classes A and B that are applied on the same element. I want to change class A only when it has class B as its sibling. Is there any css selector that can do this?
Share
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.
You can apply styles to different classes as usual:
Then chain both classes to apply more styles to elements only with both classes: