jilseego
jilseego

Reputation: 1103

How to remove or disable before and after pseudo classes?

This seems very trivial but I couldn't figure it out. Simply overriding it with display:none doesn't work on IE8.

#selector::after {
    display: none;
}

I am modifying a theme that's using before and after pseudo classes to add image sprites.

Upvotes: 11

Views: 32343

Answers (2)

simhumileco
simhumileco

Reputation: 34603

The W3C specyfication says that in CSS3 all pseudo-elements like ::before and ::after must use the double-colon syntax, but:

For compatibility with existing style sheets, user agents must also accept the previous one-colon notation for pseudo-elements introduced in CSS levels 1 and 2 (namely, :first-line, :first-letter, :before and :after).

So in your case use one-colon notation.

Upvotes: 1

bugwheels94
bugwheels94

Reputation: 31940

Use colon only one time

#selector:after {
    display: none;
}

Upvotes: 32

Related Questions