is it OK to use inherit value for ALL non-inherited css properties?
https://developer.mozilla.org/en/CSS/inherit:
For non-inherited properties,
inherit
specifies a b开发者_如何转开发ehavior that typically makes relatively little sense.
I'm wondering what exactly is the page trying to say. So is it telling us that when we do inherit
for a property which is non-inherited, the behavior is not standardized (may and may not work) ?
Because I've tried inherit
value for border
in FF, Chrome, IE, Safari, and Opera and they all work?
is it OK to use inherit value for ALL non-inherited css properties? are they part of the w3c standard?
So is it telling us that when we do
inherit
for a property which is non-inherited, the behavior is not standardized (may and may not work) ?
It works as expected in anything but IE < 8, but why would you want to make every property inherit
? If you specify a border for a parent element E
, then specify border: inherit
for E *
, then everything descending from E
is going to get the same border.
is it OK to use inherit value for ALL non-inherited css properties?
You can do so for a specific property if you really want an element to inherit that style from its parent, but it doesn't make sense for most designs in general to do it for every single property, unless your design is specifically about outlining every single rectangle with a thick red border. As an example, take a look at this catastrophic mess of a page.
are they part of the w3c standard?
If the spec lists inherit
as a valid value for that property, whether it's "non-inherited" or not (which means it isn't inherited by default), then it's technically supposed to work.
精彩评论