Possible Duplicate:
Can you target an element with CSS only if 2 classes are present?
CSS Selector that applies to elements with two classes
Is there a way to apply a CSS style to an element only if 2 classes are applied to it?
For example, apply my custom styles to this:
<div class="one two">Text</div>
But not to these:
<div class="one">Text</div>
<div class="two">Text</div>
HTML elements can be assigned multiple classes by listing the classes in the class attribute, with a blank space to separate them.
To specify multiple classes, separate the class names with a space, e.g. <span class="left important">. This allows you to combine several CSS classes for one HTML element.
What is Specificity? If there are two or more CSS rules that point to the same element, the selector with the highest specificity value will "win", and its style declaration will be applied to that HTML element.
Sure:
.one.two { border: 1px red solid }
Try to use in css selector .one.two
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With