A style is a definition of fonts,
table appearance, colours, and so on.
Each CSS style has a unique name: a selector.
The selectors and their styles are defined in one place.
In your HTML you simply refer to the selectors whenever you want to activate a certain style.
For example:
Instead of defining fonts and colours each time you start a new table cell, you can define a style and then, simply refer to that style in your table cells.
Compare the following examples of a simple table:
Classic HTML
<table>
<tr>
<td
bgcolor="#FFCC00" align="left">
<font face="arial" size="2" color="red">
<b>this is line 1</b></font></td></tr>
<tr>
<td bgcolor="#FFCC00" align="left">
<font face="arial" size="2" color="red">
<b>this is line 2</b></font></td></tr>
<tr>
<td bgcolor="#FFCC00" align="left">
<font face="arial" size="2" color="red">
<b>this is line 3</b></font></td></tr>
</table>
|
With CSS (assuming that a CSS selector called
subtext was defined)