开发者

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 inheri开发者_JAVA技巧tance 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.


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


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜