Makes lots of sense but still doesn't work, I'll take it into account this next time I start a project. Thanks a lot.
On May 3, 11:57 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote: > 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 Swedbergwww.englishrules.comwww.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.