https://jsfiddle.net/cd1o3j6x/1/
It’s extended from the example in this learning section .
it resets the property to its inherited value if it inherits from its parent or to the default value established by the user agent’s stylesheet
(from https://developer.mozilla.org/en-US/docs/Web/CSS/revert )
So why does the “revert” link I added render blue while its parent has color property of green?
My browser is Edge 99.
mikoMK
(Michael Koch)
April 2, 2022, 2:21pm
2
Hi @casinero.triste and welcome to the community
Nice catch!
I think this sentence from the “revert” article is wrong and should be removed. The user-agent stylesheet takes precedence over whether the property is inherited or not when using revert
. This is nicely shown by your example code.
Could you open an issue on GitHub: Issue with “revert”
It would also make sense to post your code there that shows the behavior and ask to extend the example on https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Cascade_and_inheritance
Thanks for reporting and have a nice day,
Michael
1 Like
@mikoMK Thank you for your reply.
I’ve opened an issue as you said by the way.
1 Like
mikoMK
(Michael Koch)
April 3, 2022, 1:13pm
4
Thank you very much!
Let’s see if they agree.
Reference:
opened 03:07PM - 02 Apr 22 UTC
closed 10:09PM - 14 Jul 23 UTC
Content:CSS
MDN URL: https://developer.mozilla.org/en-US/docs/Web/CSS/revert
#### What in… formation was incorrect, unhelpful, or incomplete?
> it resets the property to its inherited value if it inherits from its parent or to the default value established by the user agent's stylesheet
The sentence reads as if only when the property is a non-inherited one the user agent's default will take effect.
However user-agent stylesheet seems to take precedence over whether the property is inherited or not.
By the way, I'm a beginner learner and asked this for clarification on [Mozilla Discourse](https://discourse.mozilla.org/t/does-color-revert-inherit-parent-elements-color-value-or-reset-to-browser-default-for-the-selected-element/95414). Someone there replied suggesting that I should open an issue here.
#### Specific section or headline?
The first paragraph.
#### What did you expect to see?
_it resets the property to the default value established by the user agent's stylesheet, or ..._, not sure.
#### Did you test this? If so, how?
[https://jsfiddle.net/cd1o3j6x/1/](https://jsfiddle.net/cd1o3j6x/1/)
<details>
<summary>MDN Content page report details</summary>
* Folder: `en-us/web/css/revert`
* MDN URL: https://developer.mozilla.org/en-US/docs/Web/CSS/revert
* GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/css/revert/index.md
* Last commit: https://github.com/mdn/content/commit/303a6c3b8ec6658d2956c191c50aee0a0e9e4da5
* Document last modified: 2022-02-18T09:30:25.000Z
</details>