Prev | Current Page 90 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"

alistapart.com/stories/alternate/ for more information). Any style sheet lacking
a title attribute (and a rel value of stylesheet) is persistent??”always affecting a document.
These are by far the most common types of style sheets. A preferred style sheet also
takes a title along with the rel attribute and only one such style sheet can be used at a
time??”typically the first, with subsequent ones ignored. On pages that offer alternate style
sheets (typically via a style switcher), the persistent styles are always used, and the first
preferred is the additional default; the preferred styles, however, can be swapped out by
selecting an alternative style sheet. (Note that in Firefox, you should avoid adding a title
attribute to any style sheet for print, because otherwise the content may not print.)
In the previous example, the media attribute is set to all, specifying that this style sheet is
intended for all devices. But it??™s feasible to attach multiple style sheets to a web page, and
set the media attribute of each one to a different type. For instance, in the following example,
two CSS files are attached, one for screen and the other for printed output:
?? media="screen" />
?? media="print" />
There are other media types, including aural, braille, projection, and tv, but few are
supported well. However, in Chapter 10, we??™ll look at style sheets for print, which is one of
the alternatives to screen that is supported reasonably well in mainstream browsers.


Pages:
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102