Hello!
Let's say you have a div where there for example is some text in h2, h3 and p tags. Let's say you want to style the h2's and the h3's the same way. If the div class is "container" - the way I would do it now is:
.container h2, .container h3 {
font-size: 16px;
{
But then I thought, that the ".container" part is there two times.
Is there a smarter way to write it, so that you only write .container once to make the code as short as possible?
Thanks!
Why?
I suppose you could use some sort of pre-processor. Of course, that only adds a layer of abstraction that requires you to learn and use another syntax. In the end, your new complication is re-written back to the same syntax you're complaining about.
You'd be messing with the very fabric of time and space and more importantly, making debugging and maintenance more expensive.
CSS is what it is for very good reasons.
gary