0

I need the rules to apply to this element:

<div class="a b"/>

And not this one:

<div class="a b c"/>
Temani Afif
  • 211,628
  • 17
  • 234
  • 311
  • 1
    I'm aware of the :not() selector, but I'm interested if there's a way to just limit rules to a set number of classes without the additional :not() clarifications. – o4zloiroman Jul 21 '20 at 06:38

1 Answers1

1

Try this one. It will apply only on where the class name matches.

div[class*="ab"]{

 /* Write your style that  you want to apply  */

}
user13926345
  • 159
  • 10
  • I take it won't work in the case of class="b a", but it'll do. Thanks. – o4zloiroman Jul 21 '20 at 06:48
  • You can also use title tag within div and apply the style to title. For example `
    ` write css in this format `div[title~=ab]{ /*Your style */ }` Now this will apply the style to class where the title would be ab
    – user13926345 Jul 21 '20 at 06:52