How can I reset all css of all elements in a div without an external css file?

I have a widget that introduces a popup to different websites, like an absolute positioned div.

I want the popup to look the same at all. however, paragraphs and other html elements inside a div are executed by the hosting CSS.

Is there a way to reset all the properties of elements in a div an efficient way without a css file that will have to take into account all options and types of elements?

Note: I need a clean javascript / css / html solution, it is possible that jQuery is available.

+3
source share
3 answers

, , iframe . reset CSS, CSS.

+2

: , .

. , <div>, , <iframe> <div>.

, . <iframe> doctype, .

+1

Well, you can arbitrarily set some style attributes using JS, but it will be a long list, it will not be pretty or efficient, and CSS is designed to achieve the exact opposite. You can also add an inline style block with certain specific CSS selectors, and I think the tags !important, but again this is not very - on one, which ensures that the identifier is difficult / impossible.

Basically, if this is not your page, your control over it is (correctly) illusory.

+1
source

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


All Articles