Using jQuery to disable CSS inheritance

Is there a way to use jQuery (or generic javascript) to disable block level CSS inheritance? For example, if I load an external resource through javascript, say, pastie.org, they will have their own CSS, which my CSS redefines. I would like to put the embed code in my own container that inherits CSS.

This is not my own CSS structure, so I cannot rename class classes or built-in everything to make them work, the holy grail of inheritance blocking is my last resort.

+4
source share
2 answers

Have you thought about using an <iframe> to display content? Then you have an empty canvas without a set of CSS, so to speak.

+5
source

This or make sure that when you pull content that you also pull in css, you use $ ('# example'). load ('pastie.org') ;? can you specify pastie.org css?

0
source

Source: https://habr.com/ru/post/1310255/


All Articles