W3C home > Mailing lists > Public > www-validator-css@w3.org > February 2003

Re: Validator problems

From: Philippe Le Hegaret <plh@w3.org>
Date: 27 Feb 2003 16:23:34 -0500
To: Sigmund Hansen <elsiget@yahoo.com>
Cc: www-validator-css@w3.org
Message-Id: <1046381014.8012.236.camel@jfouffa.w3.org>

On Thu, 2003-02-20 at 10:52, Sigmund Hansen wrote:
> Seems there's a bug in the validator when trying to
> validate the padding element with 4 instead of 1
> padding-width attributes.
> In the css docs it says 1 or 4 attributes of type
> padding-width.
> Errors
> URI : http://www.chickensoft.com/p0wah/p0wah.css
> Line: 17 Context : .news 
> Parse Error - news_small {color: #002040; font-size:
> 10px}
> 
> Now the line before this one is:
> .news {
> color : black; 
> border-top : 1px solid #002040; 
> border-bottom : 1px solid #002040; 
> padding : 5px 0px 0px 5px; 
> } 

Your file contains
padding : 5px 0px 5px 0px; 

> But in the validator shows up as:
> .news {
> color : black; 
> border-top : 1px solid #002040; 
> border-bottom : 1px solid #002040; 
> padding : 5px 0; 
> }

which is correct even if a little bit surprising.

[[
If there is only one value, it applies to all sides. If there are two
values, the top and bottom paddings are set to the first value and the
right and left paddings are set to the second. If there are three
values, the top is set to the first value, the left and right are set to
the second, and the bottom is set to the third. If there are four
values, they apply to the top, right, bottom, and left, respectively.
]]
http://www.w3.org/TR/1998/REC-CSS2-19980512/box.html#propdef-padding

In other words, having "5px 0px 5px 0px" is similar to "5px 0".

> Anyway, it has the same problem with the margin tag if
> you use 4 attributes instead of 1. :(

ditto for margin.
http://www.w3.org/TR/1998/REC-CSS2-19980512/box.html#propdef-margin

Philippe
Received on Thursday, 27 February 2003 16:23:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 June 2012 00:14:11 GMT