Jørg, The parsing logic is sound since browsers that don't understand a given syntax on a rule will ignore it, and since the rule declares the entirety of the background property, those that can parse rgba syntax will overwrite the background image defined previously with the implicit 'none' assumed by omission.
However, the rgb portion of rgba needs to be defined in the format of 0 to 255, so to parse the rule effectively the compliant browsers need to be given the property rgba(128,128,128,.5). Personally I always thought background colour opacity should've been a sub-property of background-color. Regards, Barney Carroll (+44) 742 9177 278 On 12 Jul 2011, at 17:47, "Joergen W. Lang" <joergen_l...@gmx.de> wrote: > To define a grey semi-transparent background on a given element one could use > the following rule: > > .semi-transparent { > background: url('images/semi-transparent.png') grey; > background: rgba(50%,50%,50%,0.5); > } > > This is supposed to define a double-fallback: > > * browsers that do understand rgba() use the second declaration > * browsers that don't, ignore it and use the first one > * browsers that can load the PNG will do so > * otherwise they use a simple grey background > > (IE6 is deliberately ignored here.) > > My questions are: > Will browsers that understand rgba() still load the PNG? > Any ideas to improve the above rule? > > Any advice is welcome. > > Jørgen > ______________________________________________________________________ > css-discuss [css-d@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/ ______________________________________________________________________ css-discuss [css-d@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/