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

Re: order of properties

From: Jim Dabell <jim-www-style@jimdabell.com>
Date: Mon, 10 Mar 2003 12:29:22 +0000
To: www-style@w3.org
Message-Id: <200303101229.22529.jim-www-style@jimdabell.com>

On Tuesday 11 March 2003 12:40 am, Sigurd Lerstad wrote:
> Hello,
>
> Does the order of the properties in a style declaration matter?

Yes, for the purpose of deciding between two values for the same property.  
See http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order


> I know that the order of the style declarations matter. What I'm asking is
>
> .test {left: 20px; right:30px; }
>
> Does the order of left and right matter?

In this case no, because they are separate properties.  If it was something 
like .text { left: 20px; left: 30px; }, the meaning would change if they were 
reordered.

Watch out for shorthand properties though, such as border.  For instance, the 
colour of the border should change if these two border properties were 
reordered:

{
	color: black;
	border: thick solid red;
	border: thin;
}

-- 
Jim Dabell
Received on Monday, 10 March 2003 07:32:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:20 GMT