Simon Willison’s Weblog

Fun with body IDs

Mark has hit on the clever idea of using the body tag’s id attribute to apply different styles to different pages all from the same stylesheet. The technique is very neat, but it would be even neater if he combined it with Eric Meyer’s CSS Signatures to allow advanced users to specify their own styles for his site. Since the ID attribute can’t be overloaded with more than one value doing so would probably mean having to use the body tag’s class attribute as well—the id attribute could hold the signature while the class attribute specified the page (or vice versa).

This is Fun with body IDs by Simon Willison, posted on 16th January 2003.

Next: Who needs web standards?

Previous: PEAR out of beta

Previously hosted at http://simon.incutio.com/archive/2003/01/16/funWithBodyIds