We are really confusing two things here. When you do:
HTML Code:
<link rel=alternate media=print href="http://path/to/file.doc">
That only works in IE as far as I know, and may or may not include PDF files. I'm not sure if even when it is the 'right' sort of file if it works in all IE browsers.
In any case, that's completely different from using a print stylesheet. Here is a very basic example of using a print stylesheet (stylesheets may be external, in fact that's preferred):
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" media="screen">
/*whatever your usual style is can go here*/
</style>
<style type="text/css" media="print">
div {
display:none;
}
.printable {
display:block;
}
</style>
</head>
<body>
<div>
Stuff Here at the top we don't want printed
</div>
<div class="printable">
We want this printed
</div>
<div class="printable">
this too.
</div>
<div>
Stuff here at the bottom we don't want printed.
</div>
</body>
</html>
In virtually all browsers (including IE) that will print as:
We want this printed
this too.
The class and/or id names as well as the rules you use are up to you and it can be as complex or simple as you like. Just be aware that if something you want printed is inside of something that you don't want printed, it will inherit things like display and visibility from the thing you don't want printed. So it's best to keep them separate like in the above example.
Note: If using an external print stylesheet, it may be referenced like so:
HTML Code:
<link rel="stylesheet" href="print.css" media="print" type="text/css">
Bookmarks