HTML and CSS Reference
In-Depth Information
The <span> tag defines a left margin increased by 10% relative to this paragraph,
and changes the font size to 26 points. The only part of the document to be affect-
ed is the paragraph in which the <span></span> tags are enclosed. The text The
Three Little Bears will be displayed according to this style.
The <span> tags have no effect on this paragraph. The style reverts to the rule in
the style sheet. See Figure 14.19.
Figure 14.19 The <span> tag only affects a specific portion of the text.
14.9.2 The <span> Tag and the class Attribute
The <span> tag provides no visual change by itself. It allows you to change or modify the
appearance of a selected portion of a document within the tags based on a CSS class rule.
Example 14.19 highlights specific portions of text between the <span></span> tags.
<style type="text/css">
span.highlight { background-color:yellow }
Search WWH ::

Custom Search