Web Design

(Nancy Kaufman) #1

130


Format Text with Spans .........................................


2 Within the body text, type
<span> before a word or
words to which you want to
apply a style.
3 After the text, type
</span>.

1 In your editor, open a page
that contains an embedded
style sheet.

Format Text with Spans


C


SS formatting is applied to text by altering the appearance of the nearest HTML tag containing
the text. For most work on your page, you can simply style whatever tag already exists, such

as the paragraph. However, there will be times when you need to style a group of words or letters


within a bigger block, and in particular style a portion of text that has no other tag around it. The


tag was added to HTML to solve this issue. The tag exists solely to provide you with an


inline element to which you can apply styles.


1


2 3

Free download pdf