Linking External Style Sheets

The easiest, best supported, and most common way to apply the rules in a style sheet to a Web page is to link to the style sheet.

Figure 8.3. Here’s the external style sheet that we created on page 128 (called base.css). Don’t worry about the properties and values just yet. (It just means create a solid red border around all the img elements.)

To link an external style sheet:

1.
In the head section of each (X)HTML page in which you wish to use the style sheet, type <link rel="stylesheet" type="text/css", where text/css indicates that the style sheet is written in CSS.
2.
Type href="url.css", where url.css is ...

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide 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.