Viken Karaguesian wrote:
Quote:
Hello all,
I'm a little confused on how to implement @media to make some web pages
print better. |
If you wish, you can avoid @media by creating separate stylesheets for
each medium:
<head>
<link rel="stylesheet" href="screen.css" type="text/css"
media="screen"></link>
<link rel="stylesheet" href="print.css" type="text/css"
media="print"></link>
</head>
In this case, screen.css and print.css contain your styles for screen
and print, respectively.
Since you'll probably have many rules in common for screen and print, a
better solution is to create one single stylesheet:
<head>
<link rel="stylesheet" href="style.css" type="text/css"
media="screen,print"></link>
</head>
and style.css could look like this:
---
/* Common rules */
body { font-family: fantasy; }
h1 { border: 1px solid lime; }
@media screen {
/* Rules specifically for screen */
body { color: #faa; background-color: #002; }
a:hover { font-weight: bold; }
}
@media print {
/* Rules specifically for print */
body { color: #000; background-color: #fff; }
div#navigation { display: none; }
}
---
Note the positions of { } and ;
--
Garmt de Vries.