Reputation: 933
I'm working on a website ,the problem is this . I've some div s and tables in my page .
I've written some classes and styles for them and make them looks like the way I want .
then I add a jquery plugin and it had a css file . I include it and a lots of my styles get ruined and changed .
I used !important at class names , try to edit them and it soleve some of them but most of them are still bad .
Is there any way I make the styles separate ? a way to make the jquery css files only work for it self and doesn't effect the whole page ?
Upvotes: 0
Views: 1844
Reputation: 3868
you can:
Upvotes: 2
Reputation: 980
no beer and no code makes homer go crazy! there are two options, why the foreign css is fuckin' up your design.
1st - you use the same class and id names.
2nd - the included plugin styles the elements itself and makes no use of class names or ids
according to http://www.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/ : The last rule defined overrides any previous, conflicting rules.
nevertheless, the best approach would be, to take the plugin stylesheet and strip it of everything, that conflicts with your stylsheet, so that you have no more conflicting rules!
Upvotes: 2