# class attribute

Type: | string
Inherited: | no
See: | id

The class attribute allows an element to be defined as belonging to a certain group or "class". This is normally used to assign properties to that element from a stylesheet, based on it's class.

This example sets the color for both the heading and the paragraph by setting the class attribute

    <pdf>
      <head>
        <style>
          .redtext { color:red }
        </style>
      </head>
      <body>
        <h1 class="redtext"> This heading is red </p>
        <p class="redtext"> This paragraph is red </p>
      </body>
    </pdf>