Here is my problem. I have a list of dynamically generated classes. Each class has a color. Here is example class:
.magenta {
color: #7abbb8;
}
On the other side, I have some links in a footer. I want to use this class when <p> in footer is hovered:
(function($) {
$('footer p').hover(function() {
$(this).find('a').addClass('magenta');
});
})(jQuery);
This code works perfect - I my a have class="magenta" after p is hovered. But... it doesn't have color: #7abbb8. It probably could be easly fixed with !important, but as I said, I have a lot of these classes, they are created dynamically, so I don't want to do that. How can I do that another way?
// edit
OK, the problem is somewhere else. I didn't changed classes css, I changed css of every element which had this class. So this color will not be added with class to new elements. Unfortunately there is no simple way to solve this with jQuery, but it seems there are some plugins adding CSS rules to the stylesheet.
!important, which css rules superseed.magenta?