I realize that a similar question has been asked before, but I want to clarify that my situation differs slightly from what I have found online.
I am currently developing an embedded script that individuals can add to their websites. This script generates a div with specific width/height dimensions and contains certain information within it.
However, I'm facing an issue where some websites have styles declared for div elements which are being inherited by the div created by my script.
For instance:
div{
background-color:red;
}
This means that if I do not specify a background color for my div, it will default to red even though that is not my intention.
The only solution I have found so far is to override numerous CSS properties to ensure that my div appears exactly as I desire. The downside to this approach is that it requires overwriting a large number of CSS properties, resulting in a heavier script than I would prefer.
Therefore, my question is whether you are aware of another solution to address this problem, potentially utilizing CSS, JavaScript, or jQuery?
Thank you.