[thelist] CSS Question - Simple

Simon Willison cs1spw at bath.ac.uk
Mon Sep 15 13:57:03 CDT 2003


Rob Smith wrote:
> 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. It's the same as saying:

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

Commas mean "this selector or this selector or this selector". Spaces 
mean "a td inside a th inside a body".
Hope that helps,

Simon Willison



More information about the thelist mailing list