How do you reset ALL inherited properties for a class in a CSS file? I need to be able to set new properties on elements without pre-defined properties having an effect on it.
Is this possible using only CSS?
I am not talking about a CSS reset, such as:
body {
margin:0px;
padding:0px;
}
Simple answer - you can't.
Unless you override ALL the properties with something more specific, you cannot do this efficiently. This is extremely redundant, and I don't suggest doing it.
Instead you should avoid this completely. Don't set properties in the first place and you won't have this problem.
Also, don't do what other are suggesting and use !important
this is a bad practice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With