- From: Henri Sivonen <hsivonen@iki.fi>
- Date: Wed, 09 Nov 2005 10:49:25 +0200
Lachlan Hunt wrote: > He meant that the class names used should not be used to describe the > presentation, but rather describe the semantics. It is, however, ok to > use stylesheets to add styles based on the classes. > > eg. These are bad practice: > <span class="bold red-border"> > <p class="blue-text"> > <div class="big bold"> > > These are better: > <strong class="warning"> > <p class="summary"> > <h1 class="title"> (or simply <h1>) Of course, the UA does not care about "semantic" class names. In both cases, the UA only sees opaque strings that can be tested for equality with strings present in CSS selectors. The class names in the latter case may be "semantic" in the private universe of the author, but they do not communicate semantics to software developed by someone else without a prior agreement (possibly in the form of a third-party spec) on the meaning of the class names. As far as the UA goes, the "semantic" class names could be translated into Finnish or into Elvish or be replaced with unique random strings. So in the end, home-grown class names are just style hooks when observed outside the private universe of the author. -- Henri Sivonen hsivonen at iki.fi http://hsivonen.iki.fi/
Received on Wednesday, 9 November 2005 00:49:25 UTC