span tag
style tag
CORE ATTRIBUTE: class
class="name"
Available in versions: 4.0
HTML 4.0 tag compatibility: All tags except
base, basefront, head, html, meta, param, script, style, title
The
class
core attribute is used to assign the name of a style sheets class to a tag.
For example, all of the code samples on the
DevGuru
site are in blue colored text. This is done by enclosing the code sample inside a pair of
span
tag elements and designating a class of "CODE". In turn, the "CODE" class has been assigned a text color of blue in the style sheets file (a .css file) that is located in the Include/ directory on the
DevGuru
web site. (Thus, only one file is needed to define the appearance of the entire site.)
Code:
<span class="CODE">
The code example is blue.
</span>
Output:
The code example is blue.
The exact same effect can be accomplished using other permitted tags.
Code:
<font class="CODE">
This text is blue.
</font>
This text is not blue.
Output:
This text is blue.
This text is not blue.
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information