|
Although you may not realize it, the Web is a multi-medium information source. No, I'm not talking about multimedia-- audio and video streams, for example-- but the actual medium through which the Web's content is conveyed to us. For the vast majority of users, the medium is visual: the monitors we use every day to display pages. But there are many who also turn to the medium of print, creating "hard copies" of pages using their laser printers.
Restyling for Print
Let's now look at a real example of alternate-media stylesheets -- unfortunately, Navigator 4.x does not support alternate media on any platform, so the code won't be much help.
First, let's assume a simple page of text with some various elements: paragraphs, headings, hyperlinks, and so on ... we want to display it differently depending on whether it's on a monitor, or on paper.
First we write a stylesheet for screen display (remember, there's no accounting for taste):
/* screen display styles */
BODY {color: silver; background: black;}
A:link {color: yellow; background: #333333; text-decoration: none;}
A:visited {color: white; background: #333333; text-decoration: none;}
A:active {color: black; background: white; text-decoration: none;}
H1, H2, H3 {color: #CCCCCC; background: black; padding-bottom: 1px;
border-bottom: 1px solid gray;}
All right, now we need to decide how the printed page should look. We decide on a simple, conventional print style, without an ad banner, and so the stylesheet turns out like this:
/* print styles */
BODY {color: black; background: white;}
A:link, A:visited {background: white; color: black; text-decoration: underline;
font-weight: bold;}
H1, H2, H3 {background: white; color: black; padding-bottom: 1px;
border-bottom: 1px solid gray;}
DIV.adbanner {display: none;}
Now, to the top of the document, we add the following LINK elements:
<link rel="stylesheet" type"text/css" href="screen.css" media="screen">
<link rel="stylesheet" type"text/css" href="print.css" media="print">
Hopefully, this will solve your problem.
|