The answer is the style sheet class. The sample page here - which serves as an illustration of several of the techniques shown in this lecture - uses classes to distinguish the three kinds of table cell from each other. The code for this page is given on your handout and I suggest you look at it alongside the page itself, which you can open by clicking on the screen shot.
In style definitions, create classes by using a full stop then the class name (which you can choose) after the tag name. This class is then "called" by using the class attribute in the actual tag. Note that classes inherit all properties from the "parent" tag, so in a class (as with a pseudo-class like a:hover you only need define what is actually different from the parent (and/or the browser default).
Also note that you can create "generic" classes where properties are not assigned to particular tags in advance but can be called by any tag. This is done by omitting the tag name from the style definition but retaining the full stop and the class name. These generic classes are still called by the class attribute as before. |