Is it possible to style an element if it's tag is elementtag
and has the class myclass
.
Consider this pseudo-CSS:
button & .specialButton {
/* Add special button styling here. */
}
Is it possible to style an element if it's tag is elementtag
and has the class myclass
.
Consider this pseudo-CSS:
button & .specialButton {
/* Add special button styling here. */
}
For further actions, you may consider blocking this person and/or reporting abuse
Alverto Ortega -
Victoria -
GrahamTheDev -
Pushpa Raj Dangi -
Top comments (3)
I may be misunderstanding, but this would do what you want:
button.specialButton
.But doesn't that only work if the item with
.specialButton
is inside of abutton
element (without the requirement forelement
to be abutton
)?Or is it whitespace sensitive (i.e.
button.specialButton
!=button .specialButton
)?It's whitespace that's important:
button.specialButton
- abutton
with the classspecialButton
button .specialButton
- any element with the classspecialButton
that's anywhere inside a button.button#verySpecialButton
- abutton
with the idverySpecialButton
button #verySpecialButton
- any element with the idbutton
that's anywhere inside a button.