U of S | DCS | Courses | CAI | CSS | Using Classes

[Back] [Contents] [Next]


Using Classes


The style settings for classes are defined in the style sheet exactly like defining the appearance of an HTML tag, except that class names start with a ".". For example, to define a class called "newstuff" you could do this:

.newstuff {color:red}

Use the "class=" attribute to actually attach that class to any HTML tag (including the <span> and <div> tags discussed later). For example:

<p class="newstuff">New text here</p>

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