Trying to change CSS of pseudoclass adding a class
Dear experts,
I'm a jQuery and css beginner and I'm trying to learn it by doing. Now I have a problem, which I'm not able to solve so any help would be very appreciated.
As I looked for a solution for changing css with jquery adressing a pseudo element I found this article:
https://forum.jquery.com/topic/changing-css-of-after-pseudoclass . I tried to transfer this solution to my following code, but with no success (and please be not too hard with me, I'm really a beginner ;-) ):
CSS:
- nav.main-nav a.home:after,
- nav.main-nav li > span.home:after {
- position:relative;
- display:block;
- margin:0;
- padding:2px 0 0;
- font:1em/1 typicons;
- color:#000;
- text-indent:0;
- content: "\e08a"; }
- a.home.test:after,
- span.home.test:after {
- position:relative;
- display:block;
- margin:0;
- padding:2px 0 0;
- font:1em/1 typicons;
- color:#000;
- text-indent:0;
- content: "\e089"; }
JQuery:
- $('nav.main-nav a.home').addClass('.test');
- $('nav.main-nav li > span.home').addClass('.test');
What is wrong with the syntax if I only want to change the behavior of this child.
Thanks for any helpful hints
Fortunox