U of S | DCS | Courses | CAI | CSS | Inline Problems

[Back] [Contents] [Next]


Avoid Using the "style=" attribute


The "style=" attribute, while better than the older <font> tag, still has many limitations. For example, if you use it to display the boss's words in yellow text, then decide later boss's words should also be italicized, you would have to change ALL the style commands again.

Instead of using the "style=" attribute, define the appearance of HTML tags and "text classes" in the style sheet. Then use the "class=" attribute in your tags if necessary. That makes it easier to change the appearance of the text later because you just have to change the style sheet, not all the individual tags.


Please send comments about this course to Kevin.Lowey@Usask.CA