W3C home > Mailing lists > Public > www-validator-css@w3.org > July 2006

background: url() no-repeat [negative length] [keyword] throws error

From: Jeroen Visser | vizi <j.visser@vizi.nl>
Date: Sun, 2 Jul 2006 15:16:01 +0200
Message-Id: <d5485ba2c4771d9b11fc6589a1ef8b67@vizi.nl>
To: www-validator-css@w3.org


I may have encountered an error of the CSS validator, and as I didn't 
see a reference to it in the 'known problems' list, I figured I'd post 
it here.

The following line:

background: url(../path/to/image.jpg) no-repeat -24px bottom;

throws this error:

"Invalid number: background  Too many values or values are not 

Replacing the 'bottom' value with a 100% percentage value:

background: url(../path/to/image.jpg) no-repeat -24px 100%;

makes the rule pass validation.

In the specs it states:
"Combinations of keyword, length and percentage values are allowed, 
(e.g., '50% 2cm' or 'center 2cm' or 'center 10%'). For combinations of 
keyword and non-keyword values, 'left' and 'right' may only be used as 
the first value, and 'top' and 'bottom' may only be used as the second 
value. Negative positions are allowed."

If I have missed this one and it actually already is on the known 
issues list, I apologize for resubmitting it on this list.

With regards,

Jeroen Visser
Received on Sunday, 2 July 2006 13:16:08 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:40:42 UTC