Offering Alternate Style Sheets

You can link to more than one style sheet and let visitors choose the styles they like best. The specifications allow for a base set of persistent styles that are applied regardless of the visitor’s preference, a default or preferred set of styles that are applied if the visitor makes no choice, and one or more alternate style sheets that the visitor can choose, at which point the preferred set (though not the persistent one) is deactivated and ignored.

Figure 8.7. This CSS file (base.css) will be our persistent style sheet, and will be applied no matter what the visitor does.

To offer alternate style sheets: ...

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.