I have created an application with a element positioned at the top of the page. Directly below this element is another div.
Upon clicking a button within the first element, HTML content from a website is loaded into the second div, bringing along all its scripts and CSS which get injected into the document.
The issue arises when this imported CSS conflicts with the styles of my first element. For example, if the website's CSS alters the body margin:
body{margin:0 8px!important}
How can I prevent this interference dynamically for my first element?
I am unable to simply use:
#element1{
margin: 0 -8px;
}
since it's not a dynamic solution as other websites may have different parameters. Any alternative approaches?