Class

A class is an attribute that is applied by a web designer to a specific set of elements in a web page. The class has instructions about how to display those elements when the page is loaded.

Classes are often defined in a seperate file called a style sheet which can be used on all of the pages that make up a web site.

For example, if we have a calender grid displayed on our page, we may apply a class called "weekend" to the columns in the calendar that are for Saturday and Sunday.

In the style sheet for the web site, the class "weekend" could contain instructions to highlight the columns in a bright colour such as yellow and make the letters bold.

Classes don't have to exists in a separate fille called a style sheet, but by keeping all of the classes in one place (a separate file) presentational information is much easier to maintain and change.