buzzedword
buzzedword

Reputation: 3168

Using jQuery to disable CSS inheritance

Is there a way to use jQuery (or generic javascript) to disable CSS inheritance on a block level? For example, if I am pulling in an external resource via javascript, say pastie.org, they will have their own CSS that my CSS overrides. I would like to place the embed code into its own container that has CSS inheritance disabled.

This is not my own CSS structure, so I can't rename IDs Classes or inline anything to make it work, the holy grail of inheritance blocking is my last resort.

Upvotes: 4

Views: 1234

Answers (2)

travismillward
travismillward

Reputation: 41

That or make sure that when you are pulling in the content you pull in the css also , are you using $('#example').load('pastie.org'); ? can you specify pastie.org's css?

Upvotes: 0

Andy E
Andy E

Reputation: 344575

Have you thought about using an <iframe> to display the content? Then you have a blank canvas with no CSS set, so to speak.

Upvotes: 5

Related Questions