[thelist] CSS Question - Simple

John.Brooking at NA.SAPPI.COM John.Brooking at NA.SAPPI.COM
Mon Sep 15 13:39:59 CDT 2003


Rob asks:
> Is saying: 
>
> body {
> 	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
> 	font-size: 12px;
> }
>
> td {
>	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
>	font-size: 12px;
> }
>
> th {
>	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
>	font-size: 12px;
> }
>
> the same as...
>
> body th td {
>	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
>	font-size: 12px;
>}

No. The first three say "Here's the style for the BODY tag", "Here's the
style for all TD tags", and "Here's the style for all TH tags". The last one
says "Here's the style for a TD tag *inside a* TH tag *inside a* BODY tag.
So the last rule won't apply unless you have a TH inside a TD directly
inside a BODY, which of course is bad HTML.

What you probably are thinking of is:

   body, th, td {    # Note use of commas
      font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
      font-size: 12px;
   }

which *is* the same as the first three, and which I would recommend in this
case.

- John
This message may contain information which is private, privileged or
confidential and is intended solely for the use of the individual or entity
named in the message. If you are not the intended recipient of this message,
please notify the sender thereof and destroy / delete the message. Neither
the sender nor Sappi Limited (including its subsidiaries and associated
companies) shall incur any liability resulting directly or indirectly from
accessing any of the attached files which may contain a virus or the like. 


More information about the thelist mailing list