I'm styling a table using Sass and I want to customize the styles of an element with a certain class differently depending on this element's tag (either <td />
or <th />
).
I thought of using
.foo {
/* td styles here */
& th { /* th styles here */ }
}
but that does not work. (it selects the children of ".foo" that have the th tag)
Is there any way that I can use the Sass' "&" (ampersand) to style elements with the same class depending on their tag?