22.06.2015 Views

o_19octlt3v29m1ul81r9513q81i4ra.pdf

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7 Formatting Text by<br />

Using Style Sheets<br />

In this chapter, you will learn how to<br />

4 Specify a font family.<br />

4 Specify a font size and color.<br />

4 Apply bold and italics.<br />

4 Apply strikethrough and underlining.<br />

4 Create inline spans.<br />

4 Adjust spacing between letters.<br />

Learning how to create style rules opens up a whole new world in HTML formatting.<br />

Virtually anything that you can do in a word-processing program, you can do in HTML<br />

by using styles.<br />

You might be wondering whether the simple text-formatting tags you learned about<br />

in Part 1 of the book, such as the and tags, are still relevant. They are—to a<br />

degree. The W3C is increasingly focused on applying text formatting by using styles,<br />

which means you should try to use the style-based formatting that you’ll learn in this<br />

chapter (and the next). However, those old tags still work perfectly well when you create<br />

HTML5 documents, and Web browsers will continue to support tag-based formatting for<br />

a long time. If you’ve already created an extensive Web site that uses formatting tags,<br />

there’s no big rush to recreate the existing pages by using styles. For new pages, however,<br />

it’s a good idea to do it “right” from the start by using styles for all your formatting.<br />

In this chapter, you’ll learn about character-based formatting—that is, formatting that<br />

makes individual characters look a certain way. You’ll learn how to specify fonts, sizes,<br />

and colors; how to use styles to apply bold, italic, strikethrough, or underline styling to<br />

your text; and how to add a background to text and adjust the spacing between letters.<br />

In Chapter 8, “Formatting Paragraphs by Using Style Sheets,” you’ll learn about paragraph<br />

formatting features such as line spacing, indentation, and alignment.<br />

103

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!