November 21, 2004

Homework Assignment for December Meeting

We spoke briefly at the November meeting about the media attribute. CSS allows a designer to create different style sheets for different media that might be used to publish your HTML. Browser support for this attribute is currently limited, but printers are supported. I showed an example where the print version of a page is automatically generated when the user presses the Print button on the browser. Look at this page as an example: Minutes, September 1, 2004 (opens in a new browser window). Check the source, and within the head, you will see these lines:
<style type="text/css"
title="Default" media="screen">
@import url(../../CSS/secondaryscreen.css);

<link rel="stylesheet" type="text/css"
href="../../CSS/secondaryprinter.css" title="Default"
media="print" />
The first style sets up the page on your monitor. The second sets up the page when you print it. To see this style in action, you can print the page or just go to your top menu and use Print Preview.

This technique saves having to create a separate print version. But as I thought about how I had used the technique, I began to think there was a philosophical problem with what I did. Anyone see it? What do you think? Add your comment below or send me an e-mail.

No comments: