Part of the problem is that valid XHTML can only have one <body>
element per document. A class is generally ascribed to an element that occurs multiple times (or, rather, to a style that you want applied multiple times).
SINCE there's only ever one body, I've never added an ID or a class to it. Just style:
body {
background-color: red;
}
If you have a class you want to reuse, use a comma in your selector:
.coolStyle, body {
font-weight: bold;
color: red;
text-decoration: blink;
}
All of this is potentially meaningless, however, because anything applied to the <body>
tag will be inherited by its children unless explicitly styled otherwise.