views:

36

answers:

1

I would like to use a switch for the layout of paragraph tags on a webpage.

I use the after pseudoelement

p:after {content: url("../img/paragraph.gif");}

Now i need to remove this css code from the page. How can this be done easily (jquery is already used on the page)? (i do not want to include or remove files containing css)

+2  A: 

You need to add a css rule that removes the after content (through a class)..

p.no-after:after{content:"";}

and add that class to your p when you want to with this line

$('p').addClass('no-after'); // replace the p selector with what you need...

a working example at : http://www.jsfiddle.net/G2czw/

Gaby
that was what i was looking for - thx
Thariama
@Thariama, glad i could help :)
Gaby