Give CSS :after content a class

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.

Answers


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.


Need Your Help

Is it neccessary to check the return value of send in 0MQ with C++?

c++ zeromq

The socket_t::send function examples returns a bool to indicate if the message was sent successfully but I have never seen any sample code that checks this return value.

Strange stuttering issue with multithreading

c# multithreading xna thread-safety physics

I've modified my physics from the last post: Updating physics engine ina seperate thread, is this wise? like so:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.