user1280971
user1280971

Reputation: 105

Is there a way to not inherit CSS stylesheets for a widget?

I have a widget that customers buy to put on their site. We're running into a problem where our widget styling is being overridden by our customers' CSS. Is there anyway to disable CSS inheritance for the widget so that the only style sheet it uses is our own widget styling file? The only way we've managed to try to address this is by writing a rule for every attribute being overridden which obviously isn't very scaleable. Thanks!

Upvotes: 2

Views: 320

Answers (1)

Alexander Pavlov
Alexander Pavlov

Reputation: 32286

This is only possible if you use an iframe that hosts nothing but your widget. Stylesheets are not shared among frames in a page.

I'm not sure how you embed widgets but you can use !important on all properties you declare in your stylesheet.

Upvotes: 2

Related Questions