Forum Moderators: not2easy
1. <LINK rel="stylesheet" type"text/css" href="print.css" media="print">
or
2. @media print { } which is placed inside the CSS file
Which one is better?
Secondly, I have a normal style sheet I want my visitors to use when they browse the website, that uses the media type "all". The "all" media type includes everything, including "print". I dont want it to use that css style for print though. I want to create another style for printing, but I do not want to list out all of the media types in my main style excluding "print". The reason I dont want to do this is because the media types will change in the future and I dont want to have to go back and edit this. So if I have a style sheet:
@media all
{
body {
css, blah blah
}
}
@media print
{
body {
css, blah blah
}
}
Which one will be used when printing?
Thanks a lot for your help. I really appreciate it.
I do know that this works for me:
<style type="text/css" media="screen">@import "/css/screen.css";</style>
<link rel="stylesheet" type="text/css" media="print" href="/css/print.css" />
Maybe you don't need "all"? I'd guess that if you load the "print" style sheet after the "all", the print version will take care of printing. I'm sure you can test it, but why not just use "screen" instead of "all"? That would answer all of your concerns, I think.