Suppose I have a CSS class:
.text-red {
color: red;
}
This class is defined elsewhere, may be supercomplex, and is not editable.
In my DOM I have several paragraphs. I want to apply text-red class to all paragraphs. Of course I may write that directly:
<p class="text-red">XXX</p>
<p class="text-red">YYY</p>
<p class="text-red">ZZZ</p>
<p class="text-red">WWW</p>
but it is so redundant. I'd like to write in my CSS file something like:
p {
.text-red
}
so that all "p" elements have that class applied. Clearly this is not a CSS valid rule. How may I do?