Bachalo
Bachalo

Reputation: 7219

Handling pseudo-elements ::before and ::after when targeting IE6 IE7

Can any CSS3 experts tell me the best strategy for handling the before and after pseudo elements with IE6 and IE7?

Upvotes: 0

Views: 577

Answers (2)

Michas
Michas

Reputation: 9428

I write a small script for old IE to add special elements in DOM. (Via IE conditional comments.) The rest of common browsers get this by pure CSS. The downside is I have to write the code twice. The upside, I have IE only code in one place.

Upvotes: 0

Jens Grochtdreis
Jens Grochtdreis

Reputation: 59

If you use jQuery it is a simple one-liner. Just use prepend() and inject a span with a class .before (for the simplicity of changing the CSS). I've made a fiddle for you.

Upvotes: 2

Related Questions