Re: CSS2 Syntax: tables

On Wed, 8 Jul 1998, Ian Samson wrote:

> From: http://www.w3.org/TR/WD-CSS2/tables.html#h-17.6
> Here is an example:
> TD.blue {border: medium solid blue} TD.thick {border: thick 
> solid red}
> TD.double {border: thick double black} TR {border: medium 
> dotted green}
> with this document:
> <P>
> <TABLE>
> <TR><TD>1<TD class="blue">2<TD>2
> <TR><TD>4<TD class="thick">5<TD>6
> <TR><TD>7<TD class="double">8<TD>9
> </TABLE>
> 
> Am I missing something here? What is the purpose of defining "TD.blue"
> when a simple ".blue" would suffice? 

I would guess because TD.blue will only affect TD elements with class
blue. Then if you have

.blue { color: blue }

you won't get unexpected effects to do with the border changing on other
elements.

> Same goes for the other occurrences. Also, are the double-quotes around
> the attributes entirely necessary; "blue", "thick", "double", when <TD
> CLASS=blue>, <TD CLASS=thick> and <TD CLASS=double> work just as well? 

They aren't necessary. (However it might be worth pointing out that some
syntax-colouring editors don't really understand how literals work. In
any case it's possibly arguable that stylistically it's a little clearer
to quote them.)

James

-- 
/--------------------------------------------------------------------------\
  James Aylett, dj@insigma.com                    Insigma Technologies Ltd
  Tel: +44 (0)1285 643100                         Norcote Barn     Norcote
  Fax: +44 (0)1285 643600                         Cirencester      GL7 5RH

Received on Wednesday, 8 July 1998 08:19:43 UTC