HTML CSS

HOW TO RESET CSS FROM ELEMENT

1) INITIAL

#demoAP { color: red; } #demoAC { color: green; }   <div id="demoAP"><p id="demoAC"   onclick="this.style.color='initial'">   Green - Will reset to black. </p></div> 

reset to browser default

2) INHERIT

#demoBP { color: red; } #demoBC { color: green; }   <div id="demoBP"><p id="demoBC"   onclick="this.style.color='inherit'">   Green - Will reset to red. </p></div> 

reset to parent's style

3) UNSET

#demoCP { color: red; } #demoCC, #demoDC { color: green; }   <div id="demoCP"><p id="demoCC"    onclick="this.style.color='unset'">    Green - Will reset to red. </p></div>   <div id="demoDP"><p id="demoDC"   onclick="this.style.color='unset'">   Green - Will reset to black. </p></div> 

reset to parent if set, browser default if not

4) REVERT

#demoEP { color: red; }   <div id="demoE"    onclick="this.style.color='revert'">  Red - Will reset to whatever color the   user has set. If not, will revert to    black. </div> 

reset to user custom style if set browser default if not