![]() |
||
"class=" attribute![]() |
![]() |
|
Only one class can be used per selector.
The class name used can be any combination of alphanumeric characters. The maximum number of characters is unknown at this time but try a maximum of 8 until more specific information is available.
A class when it is defined is delimited by a leading period, separating it from the selector:
There are a few specific class names that are reserved for page specific functions. These are called pseudo-classes. At present, there are only three pseudo-classes and they are used exclusively with the <a> tag.
This allows the modification of how links are presented in a page. This is similar to <body alink= link= vlink=>. The difference is that the 'alink=', 'link=' and 'vlink=' attributes modify the colours for the entire page. The pseudo-classes allow changes based on the specific situation of use.
Consider this link. When you hold down the mouse button on it, it will turn yellow. After clicking on it, it would turn red if there were a real page behind it.
The CSS1 standard stipulates that the selector need not be included when defining these pseudo-classes. Since pseudo-classes are only used with the anchor tag, they are sufficiently unique as not to need to anchor selector. However, if you view the source, the anchor selector is there. MSIE 4.0 has not adhered to this part of the standard, yet.
Netscape has defined "class=" in two ways.
Netscape 3.0 defines it as follows:
CLASS="type" identifies and specifies the characteristics of the element.
Netscape 4.0 defines it as follows:
CLASS="classType" specifes to which class of style an element belongs.