The concept in action here is css inheritance.
Every element added to the page will adopt styles based on the css of that page.
To ensure your added element follows the desired styling, you must use classes to make the css more specific than any conflicting rules from the page's existing css.
It's essential for the css rules of your new element to be more specific than others. This is analogous to being detailed in verbal communication.
Rule 1
table tbody td span{ font-weight: bold; }
Rule 2
table span{ font-weight: normal; }
In this scenario, rule 1 takes precedence over rule 2 due to its greater specificity.
To gain a better understanding, refer to htmldog's page on css specificity
To reset the css styles and then reapply them, encapsulate everything in a div with class="jibber-nav"
You can achieve this by:
.jibber-nav,
.jibber-nav ul,
.jibber-nav li,
.jibber-nav a{
background: none;
color: #000;
font-family: sans-serif;
padding: 0;
margin: 0;
}
/**** Add desired styles below *******/
.jibber-nav li{
border: 2px solid #123456;
border-radius: 4px;
}
.jibber-nav a{
color: #097654;
}
If all else fails, resorting to !important for all css rules should be avoided as it can lead to confusion and complexity in code management.