HTML and CSS Reference
In-Depth Information
Given that the link element is an empty element when using XML-style syntax,
a self-identifying close using a trailing slash (/) must be included in the tag:
<!-- XHTML style -->
<link rel="stylesheet" type="text/css" href="/styles/newstyle.css" />
The rel attribute is generally set to the value stylesheet but may also have a value of
alternate stylesheet with an associated title value to provide different looks for the
same page:
<link rel="stylesheet" type="text/css" href="standard.css" title="standard">
<link rel="alternate stylesheet" type="text/css" href="red.css" title="Red
<link rel="alternate stylesheet" type="text/css" href="green.css"
title="Green Sheet">
The media attribute may also be used to define the media to which a style sheet is
applied. The keyword values screen and print are commonly. The default value of all is
applied when media is not specified.
<link rel="stylesheet" type="text/css" href="screenstyle.css" media="screen">
<link rel="stylesheet" type="text/css" href="printstyle.css" media="print">
CSS2 and 2.1 do define a rich set of media values, as shown in Table 5-2, but in practice
few are supported.
Media Type
For use with all devices
For use with speech synthesizers. Support for this is spotty and most features
have been moved to later version of CSS.
For use with tactile Braille devices
For use with Braille printers
For use with handheld devices
For use with printed material and documents viewed onscreen in print preview mode
For use with projected media (direct computer-to-projector presentations), or printing
transparencies for projection
For use with color computer screens
For use with speech synthesizers; replaces the CSS2 value aural
For use with low-resolution teletypes, terminals, or other devices with limited
display capabilities
For use with television-type devices
T ABLE 5-2 Media Types Defined by CSS 2.1
Search WWH ::

Custom Search