Re: order of properties

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:26:05 UTC