3 ms·
"Because this attribute is typically implemented using CSS, it’s also possible to override it using CSS. For instance, a rule that applies 'display: block' to a
by msimpson 9y ago
"Because this attribute is typically implemented using CSS, it’s also possible to override it using CSS. For instance, a rule that applies 'display: block' to all elements will cancel the effects of the hidden attribute. Authors therefore have to take care when writing their style sheets to make sure that the attribute is still styled as expected."
-- HTML 5.1 - W3C Recommendation, 1 November 2016
So, as you can see, this is by design.
If this attribute behaved only in the manner the author assumes it would be essentially useless.
Instead, we have an option to have it act as "display:none", "visibility:hidden", etc.
Also, it has accessibility benefits beyond "aria-hidden":
https://www.paciellogroup.com/blog/2012/05/html5-accessibility-chops-hidden-and-aria-hidden/ https://www.paciellogroup.com/blog/2012/05/html5-accessibili...