Problem description
I would like all my h2
, h3
, p
and picture
children of an article
to have the following css rule:
margin-left: 16px;
margin-right: 16px;
What am I doing
So I'm using the >
operator in CSS:
article > h2, article > h3, article > p, article > picture {
margin-left: 16px;
margin-right: 16px;
}
However this form requires a lot of repetition of the article
keyword, and I really need these changes to only apply to children of an article
. Is there any way to compress this rule using the word article
only once?
My attempt fails
I tried to do this:
article > (h2, h3, p, picture) {
margin-left: 16px;
margin-right: 16px;
}
But it seems to me that it's not something acceptable for the CSS language.