W3C home > Mailing lists > Public > html-tidy@w3.org > July to September 2003

Re: appending styles with underscore

From: Christophe Strobbe <christophe.strobbe@esat.kuleuven.ac.be>
Date: Wed, 02 Jul 2003 10:10:22 +0200
Message-Id: <>
To: "Browning, Glen J ERDC-ITL-MS Contractor" <Glen.J.Browning@erdc.usace.army.mil>, "'html-tidy@w3.org'" <html-tidy@w3.org>

Hi Glen,

The underscore in class="centBoldWhite_c1" is not meant to join two classes 
('centBoldWhite' and 'c1'); it is a new class. Can you check that there are 
no other elements with class="c1" in the Tidy output? It's these elements 
that are affected by the new style definition generated by Tidy.

I would also like to mention that it is better to avoid underscores in ID 
and CLASS values, even though they are permitted: see Eric Meyer's note on 
Netscape Devedge: http://devedge.netscape.com/viewsource/2001/css-underscores/.

Best regards,

Christophe Strobbe

At 22:02 01/07/2003, Browning, Glen J ERDC-ITL-MS Contractor wrote:

>I have been using the tidy tool for about two months now, and I have
>stumbled across a behavior that I do not understand.
>In the case of the following markup:
>              <td bgcolor="#000000" colspan=4><p class="centBoldWhite"><i>
>Some Text</i></p></td>
>tidy generates this:
>              <td bgcolor="#000000" colspan="4">
>                 <p class="centBoldWhite_c1">Some Text</p>
>              </td>
>Please note the "_c1" which has been appended to the existing class name
>"centBoldWhite".  This refers to a new style definition which tidy creates
>as follows:
>                <style type="text/css">
>                   p.c1 {font-style: italic}
>                </style>
>It appears to me that tidy is trying to append the contents of the new class
>"c1" onto the existing class "centBoldWhite".  While this seems like a very
>useful thing to be able to do, neither IE nor Netscape wil actually render
>the new "centBoldWhite_c1" construct.
>Is this an error, or is the "_" really supposed to join classes?  If an
>error, how does one assign multiple classes to an element?  If it is
>supposed to work, can you suggest an explanation for why it doesn't work for
>Any help would be greatly appreciated.
>Glen Browning.

Christophe Strobbe
K.U.Leuven - Departement of Electrical Engineering - Research Group 
on  Document Architectures
Kasteelpark Arenberg 10 - 3001 Leuven-Heverlee - BELGIUM
tel: +32 16 32 85 51
Received on Wednesday, 2 July 2003 04:08:21 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:53 UTC