Creating and Linking to External Style Sheets

Embedded style sheets work well for single-page Web sites, but to really take advantage of what cascading style sheets can do, you need to make an external style sheet. A single external style sheet can be linked to multiple documents, ensuring complete consistency even in a large site. An external style sheet also makes it easy to change the formatting of your site after the pages have been constructed. Rather than having to edit each page individually, you can simply change the style sheet.

An external style sheet is a plain text file, just like an HTML file. The only difference is that you assign it a .css rather than an .htm extension. It contains anything you would place within the <style> tag ...

Get HTML and XHTML Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.