DEV Community

Discussion on: How do you reset CSS properties?

Collapse
wrldwzrd89 profile image
Eric Ahnell

My favorite strategy for this is to use Normalize.css, or something derived from it, to get known defaults, which makes removing my customizations simpler. Of course, if I simply need to inherit from the parent, I use "inherit" as the style value.

Collapse
dzhavat profile image
Dzhavat Ushev Author

Using Normalize is quite handy. But this tool just makes sure you have consistent starting point between browsers. What about resetting a property during run time? Say you have set a background-color that you want to reset back to its default value? Would you use transparent, initial, unset or something else?

Collapse
wrldwzrd89 profile image
Eric Ahnell

initial if I am reverting a change I made; inherit if I overrode the parent and wish to undo it, unset otherwise.