Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 631
jilseego Avatar asked Jul 25 '12 12:07

jilseego


People also ask

What are before and after pseudo-classes?

CSS ::before and ::after pseudo-elements allow you to insert “content” before and after any non-replaced element (e.g. they work on a <div> but not an <input> ). This effectively allows you to show something on a web page that might not be present in the HTML content.

Which is the correct order for using pseudo-classes?

The recommended order is link,visited,focus,hover,active. The :link and :visited pseudo-classes should generally come first. Next should be :focus and :hover—they're specified now so that they override and apply to both visited and unvisited links.

What is :: before and :: after?

Definition and UsageThe ::before selector inserts something before the content of each selected element(s). Use the content property to specify the content to insert. Use the ::after selector to insert something after the content.

What can you do with the before pseudo element?

The ::before pseudo-element can be used to insert some content before the content of an element.


1 Answers

Use colon only one time

#selector:after {
    display: none;
}
like image 78
bugwheels94 Avatar answered Oct 16 '22 17:10

bugwheels94