Ich habe diese Divs, mit denen ich style .tocolor, aber ich brauche auch die eindeutige Kennung 1,2,3,4 usw., also füge ich hinzu, dass es sich um eine andere Klasse handelt tocolor-1.
<div class="tocolor tocolor-1"> tocolor 1 </div>
<div class="tocolor tocolor-2"> tocolor 2 </div>
<div class="tocolor tocolor-3"> tocolor 3 </div>
<div class="tocolor tocolor-4"> tocolor 4 </div>
.tocolor{
background: red;
}
Gibt es eine Möglichkeit , nur 1 Klasse haben tocolor-*. Ich habe versucht, einen Platzhalter *wie in diesem CSS zu verwenden, aber es hat nicht funktioniert.
.tocolor-*{
background: red;
}