CSE691/891 - Internet Programming Summer 2001
prev next

Style Syntax

Styles can be applied to all tags of a given type, a style class can be applied to any tag that requests it, and styles can be inherited from the tags of parents.

  1. A style can be applied to a group of tags this way:
    h2, em { font-weight: bold; font-size: 14pt; }
    This style makes all h2 and em tags have the style bold and have 14pt text.
  2. You can define a style class that can be applied to any individual tags, as the need arises.
    .code { font-family: courier; font-size: 12pt; }
    This class defines a style for rendering code fragments, and is being used for the fragment above.

    You apply the class this way:

    <blockquote class="code"> ... </blockquote>
    This fragment was taken from the source for the code fragment above. We can apply this code style to any tag in our web page to render code fragments in a standard way.
On the next page we show all the styles used in the stylesheet for these notes.


prev next