In general, IDs take precedence over classes for CSS style rules. One thing you could do is refer to a containing element's ID in the style rule for the class. Something like this:
#container .new_class { color: #FFF; } hope that helps. --Karl _________________ Karl Swedberg www.englishrules.com www.learningjquery.com On May 3, 2008, at 11:23 PM, rene.olivo wrote:
Hello, I have tried this code: $('#some_div').addClass('new_class'); And it works really well, it adds the class to the element. The problem is that if this element had previously had any style applied to it like: #some_div { color: #F00; } to change the color with the new class I'd have to use !important so it can be applied like this: .new_class { color: #FFF !important; } does anyone knows why this happen? it works great and everything but I rather not use the important statement if possible. thanks.