Without using Javascript, is there a way to make the CSS property on and off through nested elements.
The problem I'm trying to solve is that I have several tags and classes that make the text in italics ( <em> , <blockquote> , <cite> , <q> , <dfn> and some other classes), and when one of them is inside the other of one of them, italicisation must be switched.
<blockquote>
And so the man said, <q> That not from <cite> Catcher In The Rye </cite>, dear
fellow! </q>, can you believe that ?!
</blockquote>
Should display as:
And this man said: โThis is not from Zazerka in the rye, dear friend!โ, Can you believe it ?!
The CSS I have for this gets a little messy:
q, em, dfn, cite, blockquote { font-style: italic; } qq, q em, q dfn, q cite, em q, em em, em dfn, em cite, dfn q, dfn em, dfn dfn, dfn cite, cite q, cite em, cite dfn, cite cite, blockquote q, blockquote em, blockquote dfn, blockquote cite { font-style: normal; }
... and I'm sure that even one level of nesting will not pass (as in my example).
Is there a way I can do this without having to list each tag permutation?