I’m just wondering if it is possible to assign a CSS class to the content added by an :after pseudoelement. Something like this:
span:after {
content: "after!"
class: red
}
I know you can specify several style attributes like font-size and so on, so I could imagine applying a class should be possible, too.
Acutally, I’m trying to append a glyphicon via bootstrap CSS this way. But a simple
span:after {
class: icon-wrench
}
didn’t do it.
Pseudo-elements can’t have classes. You can only apply individual style rules to them directly. There isn’t a way to copy styles from a real element of a certain class to its pseudo-element either, unless you specifically select it, something like
span.icon-wrench:after.