U of S | DCS | Courses | CAI | CSS | Stylesheet Example

[Back] [Contents] [Next]


Stylesheet Example


Below is an example of a style sheet where we've combined several style definitions together in one place. The text between /* and */ are comments, ignored by the cascading style sheet.
/* Put all the headings in sans-serif, navy letters */
h1,h2,h3,h4,h5,h6 {
  font-family:sans-serif;
  color:navy;
}

.newstuff {color:red} /* Text identified as class="newstuff" is red */
h1 em {color:orange;} /* emphasized text in h1 headings is orange   */

body {
  color:black;              /* text foreground color black */
  background-color:white;   /* text background white       */
  /* put a "cloud.gif" background image on the page        */
  background-image:url(http://www.usask.ca/images/cloud.gif);
  font-family:serif;        /* use the serifed font family */
}

a:link {color:blue}         /* Unvisited links are blue    */
a:visited {color:purple}    /* Visited links are purple    */
a:active {color:red}        /* Active links are red        */

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