Creating Style Sheets for Handhelds

You can create an entirely independent style sheet that will only be used for your Web page when it is viewed in a telephone, PDA or other handheld device.

To create a style sheet for handhelds:

1.
In the head section of your XHTML document, type <link rel="stylesheet" type="text/css" href="url.css", where url.css is the location of the handheld style sheet on the server.
2.
Next, type media="handheld" to indicate that this style sheet be used only for small screen devices.
3.
Close the link tag with />.
4.
If desired, in the link tag for your main style sheet, type media="screen" so that the styles you’ve set up for regular screens are not used for handheld browsers.

✓ Tips

  • The default value for media

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.