Class Names

You can choose class names when authoring your CSS and XHTML. A good rule is to create "logical" class names and not "descriptive" ones. Remember, you've gone to the trouble of separating markup and presentation -- keep this separation when creating class names.

If you can guess how the class is styled based upon the name, this should cause you to consider changing the name.

Good Class/ID Names Poor Class Names
  • globalnav
  • sitenav
  • gallery
  • imgcaption
  • aside
  • warning
  • thinborder
  • rightcolumn
  • rightnav
  • redbold
  • center

Choosing class and id names appropriately will help with:


See: Choosing Class and ID Names