使用jQuery来禁用CSS继承 [英] Using jQuery to disable CSS inheritance
问题描述
有没有办法使用jQuery(或通用javascript)在块级别禁用CSS继承?例如,如果我通过javascript拉入一个外部资源,说pastie.org,他们将有自己的CSS,我的CSS覆盖。我想将嵌入代码放置到自己的容器中,并禁用CSS继承。
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.
这是不是我自己的CSS结构,所以我不能重命名ID类或内联任何东西使它工作,继承阻塞的圣杯是我的最后手段。
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.
推荐答案
您是否考虑过使用< iframe>
来显示内容?然后你有一个没有CSS集的空白画布,可以这么说。
Have you thought about using an <iframe>
to display the content? Then you have a blank canvas with no CSS set, so to speak.
这篇关于使用jQuery来禁用CSS继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!