Chapter 9. Applying Styles

In the previous chapter you learned how to construct individual style rules. In this chapter, you’ll learn how to combine those style rules into a style sheet and then apply that style sheet to an individual element, a whole Web page, or an entire Web site.

We start working on the actual properties and allowed values in Chapters 10, Formatting with Styles, and 11, Layout with Styles.

Creating an External Style Sheet

External style sheets are ideal for giving all the pages on your Web site a common look. You can define all your styles in an external style sheet and then tell each page on your site to consult the external sheet, thus ensuring that each will have the same settings.

To create an external style sheet

  1. Create a ...

Get HTML for the World Wide Web, Fifth Edition, with XHTML and CSS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.