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

Brackets and parentheses in URLs/URIs in CSS

From: Etan Wexler <ewexler@stickdog.com>
Date: Thu, 07 Jul 2005 00:03:26 -0400
Message-ID: <42CCA98E.4040109@stickdog.com>
To: W3C CSS-validator list <www-validator-css@w3.org>
CC: Will Barker <will.barker@rhads.co.uk>

David Dorward wrote to the W3C CSS-validator list 
<mailto:www-validator-css@w3.org> on 11 April 2005 in “Brackets in URLs 
(was FW: bug.)” (<mid:20050411134529.GD21658@us-lot.org>, 

> On Mon, Apr 11, 2005 at 02:41:45PM +0100, Will Barker wrote:
> [...]
> [...]
> Brackets are not allowed in URLs. That should be represented as:
> ../images/cms/hondatopba%281%29.jpg

Parentheses are allowed as reserved URI characters in the Internet 
standard “Uniform Resource Identifier (URI): Generic Syntax” 
(<urn:ietf:rfc:3986>, <http://www.ietf.org/rfc/rfc3986.txt>, or in your 
RFC repository of choice). The relevant rule follows.

    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
                  / "*" / "+" / "," / ";" / "="

The URI-syntax standard also permits square brackets as delimiters for 
certain Internet Protocol addresses (IP addresses). The relevant rule 

    IP-literal    = "[" ( IPv6address / IPvFuture  ) "]"

Because parentheses and brackets are reserved characters in URIs, 
escaping parentheses and brackets at the URI level changes the formal 
semantics. The operational semantics might stay the same for a while, 
but authors should not rely on such behavior.

Still there is the issue of parentheses in an unquoted URI in a 
Cascading Style Sheet. Escaping at the CSS level provides an easy 
solution without changing any of the URI’s semantics. The following 
example meets all the technical needs of URI and of CSS.


Square brackets in URIs in CSS do not need CSS escaping.

Curly braces must not appear in URIs. Authors can represent curly braces 
in URIs by escaping at the URI level, like the following example shows.


Etan Wexler.
Received on Thursday, 7 July 2005 04:00:48 UTC

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