Bobby Jack wrote: > I'm surprised no-one's pointed out the obvious: that using > "background" will override all other background-* properties (to > their default values), in addition to setting background-color.
It's very obvious if you look at CSS specifications, but they aren't everyone's breakfast. I, too, was surprised at the discussion, as the relevant point was frequently missed and incorrect statements were made (e.g. about conciseness being the only issue). When using the background shorthand, you unavoidably set all background properties, and this is usually a good thing. It avoids rare but nasty situations where your color suggestion is applied and so is your background color suggestion, but some other style sheet throws in some background image... the shorthand avoids this by setting background-image: none by default. > Using > "background-color" will just set that property and inherit the > others. No, it won't inherit anything. It has nothing to do with inheritance. Inheritance is the most widely misunderstood, and perhaps the most unfortunate of all CSS concepts. When you set background-color: #fff, you do not affect other background properties in any way. Whether they are inherited or not depends on other factors. The main factor is that according to CSS specifications, none of the background properties is inherited in the normal sense (inherited in the absence of any CSS rule that assigns a value to the property), though in principle they can be inherited if the explicit value inherit is used (as for any property). -- Yucca, http://www.cs.tut.fi/~jkorpela/ ______________________________________________________________________ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/