W3C home > Mailing lists > Public > www-style@w3.org > May 2002

Re: the . class selector

From: L. David Baron <dbaron@fas.harvard.edu>
Date: Fri, 17 May 2002 14:35:23 -0400
To: Sigurd Lerstad <sigler@bredband.no>
Cc: www-style@w3.org
Message-ID: <20020517143523.A26787@is10.fas.harvard.edu>
On Friday 2002-05-17 20:18 -0700, Sigurd Lerstad wrote:
> I'm trying to apply a css stylesheet to nitf documents. I have a problem,
> many of the nitf elements have names like <body.head> and <body.content>,
> but the . symbol is reserved for specifying a class in a selector, how do I
> overcome this ?

Use backslash-escapes.  See http://www.w3.org/TR/REC-CSS2/syndata.html#q4

For example:

body\.content {
    display: block;
    background: white;
    color: black;
}

This works in Mozilla.  I'm not sure about other browsers.

-David

-- 
L. David Baron        <URL: http://www.people.fas.harvard.edu/~dbaron/ >
Received on Friday, 17 May 2002 14:35:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:14 GMT