URLs in CSS

Several CSS properties take URL values. Up to now, URLs have been
identified with quotes. This works quite well for absolute links:

  BODY { background: "http://foo.com/png/marble" }

However, relative links can be confusing:

  BODY { background: "red" }  /* relative URL */
  BODY { background: red }    /* color name */

Here are some suggestions for alternative schemes;

  BODY { background: [http://foo/bar] }
  BODY { background: url:http://foo/bar }
  BODY { background: href:red }
  BODY { background: url:red }
  BODY { background: url(red) }
  BODY { background: url(http://foo/bar) }

Also, should the identification be optional for absolute URLs?:

  BODY { background: http://foo/bar } 

The syntax would still be nonambigous (assuming no color names with
colon in them), but error recovery could be harder.

Comments welcome.

-h&kon

Hakon W Lie, W3C/INRIA, Sophia-Antipolis, France
http://www.w3.org/people/howcome  howcome@w3.org

Received on Thursday, 11 April 1996 05:38:48 UTC