Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook

(Nora) #1

142 CHAPTER 4 Getting started with CSS3


the rendering of an HTML document. The following is a list of the media types that are avail-
able for use.
■■all Renders to all devices
■■braille Renders to braille tactile feedback devices
■■embossed Renders to paged braille printers
■■handheld Renders to handheld devices that typically have small, low-resolution
screens and limited bandwidth
■■print Renders paged material and documents viewed on screen in print preview
mode
■■screen Renders to color computer screens
■■speech Renders to speech synthesizers
■■tty enders to media, using a fixed-pitch character grid such as teletypes, terminals, R
and portable devices with limited display capabilities
■■tv Renders to television-type devices that typically have low-resolution color screens
with limited ability to scroll and have sound
The following is an example of an HTML document that contains <link> elements for
screen styles and print styles.
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title></title>
<link rel='stylesheet' type='text/css' href='Content/screen.css' media='screen' />
<link rel='stylesheet' type='text/css' href='Content/printer.css' media='print' />

</head>
<body>

</body>
</html>

You can specify a CSS file as being applicable to multiple device types by comma separat-
ing each device type within the quotes.

Quick check
■■You want to provide a separate style sheet file for styles that are to be used when
a webpage is rendered to the printer. Which media attribute setting should be
set with the <link> element?

Quick check answer
■■media = ‘print’
Free download pdf