W3C home > Mailing lists > Public > www-style@w3.org > March 2008

[CSS21] background shorthand and inherit value

From: olivier Thereaux <ot@w3.org>
Date: Tue, 25 Mar 2008 13:06:54 -0400
Message-Id: <9D1C0CD9-7D18-4B62-9C0E-BDC4A06DBF0C@w3.org>
To: CSS list <www-style@w3.org>

Hello, CSS WG, all

I hope this is the right forum to ask a question about a CSS  

We recently received a bug report on the CSS validator:

The bug reporter would like to use the current syntax:

#frontHeader {
  background:inherit url(img/banner_two.jpg) no-repeat left bottom;

Now, the "background" property has always been a bit of a mystery to  
me. I can't really wrap my head around the fact this shortcut property  
sets number of individual properties in any possible order. So I may  
just be confused.

The spec (CSS21) says:

     Value:  	[<'background-color'> || <'background-image'> ||  
<'background-repeat'> || <'background-attachment'> || <'background- 
position'>] | inherit

Which can be interpreted as "shorthand for a number of the background  
properties" OR inherit, alone. But since each of the individual  
properties can themselves have "inherit" as value, I suppose the CSS  
block quoted above is fine?

Now, if the above is fine, how about the following. Is this acceptable  
per the CSS spec? and if so, how should this be parsed?

p {
background: inherit inherit;

Would appreciate any guidance in understanding this better.

Received on Tuesday, 25 March 2008 17:07:26 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:35 UTC