March 1, 2006
MarkBernstein.org
 

CSS trick: body classes

Ryan Singer runs down a handy CSS trick I've found useful in Flint and elsewhere.

All HTML files enclose the page content in a tag. If you have a site with different kinds of pages -- a weblog with a Main Page and individual Post Pages, perhaps -- you add a class or ID to the body tag. Then, your stylesheet can easily say things like "pages are red, except the main page is blue".