Style Rules
Embedding a Style Sheets
External Style Sheets
Importing a Style Sheets
Styles Inline
Class
ID
SPAN and DIV
Quick Reference Table
HTML Tutorial
Databases and ASP
   


Class Attribute

The CLASS attribute is used to specify the style class to which the element belongs. For example your external or imported style sheets may have the following classes:

P.doom { font-size: 20pt; color: blue }
p.zoom { font-size: 10pt; color: red }

You can also create classes that are not attached to any HTML tag eg:

.shop { color: #999999; font-family: verdana; font-size: 15pt}

These classes could be referenced in HTML with the CLASS attribute:

<HTML>
<HEAD>
<TITLE>CLASSES</TITLE>
P.doom { font-size: 20pt; color: blue }
p.zoom { font-size: 15pt; color: red }

.shop { color: brown; font-family: verdana; font-size: 15pt}
</HEAD>
<BODY>
<p class="doom">Who wants to be a millionaire!!!</p>
<p class="zoom">I would not mind, how about you?</p>
<p><a class="shop" href="http://www.koodesign.co.uk/webdesign/">Web Design </a></p>
</BODY>
</HTML>

Click here to see the results: