It is not possible to revert a property of an element back to the browser default once a CSS rule has been applied that sets a value for that property. For instance, if a style sheet defines font-size: 13px
on a select
element, you cannot instruct the browser to ignore this setting and use its own default instead.
Instead, you can override existing settings by explicitly defining a new value, like so: select { font-size: 18px }
. If this approach does not produce the desired result, then there may be an issue with how you implemented it.
You may attempt to assign values that you assume are standard browser defaults, but there is no assurance that all browsers—both present and future—will adhere to these specifications.
In a previous version of the CSS Cascading and Inheritance Level 3 draft, there was a proposed default
keyword designed to "roll back the cascade." However, this concept has since been omitted in the current iteration of the draft, which introduces the unset
keyword as an alternative. It's important to note that while unset
can reset properties to their initial values according to CSS specifications, it does not necessarily equate to using browser defaults.