Alternative style sheets

A document can have multiple style sheets associated with it. The user is given an option to choose. Not all browsers support this feature.

To include extra style sheets, add more <link> elements in <head>, with the rel and title attributes as follows.


 <link type="text/css" rel="stylesheet"
   title="default style" href="default.css" />
 <link type="text/css" rel="alternate stylesheet"
   title="high contrast" href="highcontrast.css" />
 <link type="text/css" rel="alternate stylesheet"
   title="large font" href="largefont.css" />

Groups of links with the same <title> are automatically combined into one style sheet.

practice

Go to the folder CSS sample 1 folder . Open css-toggle.html. Test the funtionality of stylesheet toggling using a user agent. Is it possible? What happens?

  • in Netscape 6, select "View" -> "Use Stylesheet"
  • in Opera?
discussion

What alternatives are there to alternate style sheet provision?