Forum Moderators: not2easy
Looking at those web sites using css2 for the complete layout of the pages, I see there is always a style sheet specifically for printing the pages included .
1st question : what should there be specifically in the print one compared with the media : all?
2nd question : should it be a <link rel ...> or an @import
Thanks for your answers. They help me a lot in my progression of css :-))
i think it has to be link rel as that is where you specify media=print
ta
ben
obviously if you have an image that illustrates an article, it would bewise to leave that in, but if its just decoration then you might as well get rid.
i think its a case of just trying a few things and see which gives the best/clearest printed reults. it maybe that setting the font to times or serif will also help, as these can be easier to read in print.
good luck
Remember, though, the layout of the page doesn't have to correspond to the layount on the screen. That's the beauty of using CSS and separating content from presentation.
Start with a blank sheet, and decide afresh what has to go onto the printed page and where each element should go.
An even better solution is to include some identifier on the printed page with your URL and site name on it. You can set this element to display: none; in the screen version then bring it out in the print styles.
Also, remember that sans-serif fonts are best for on screen, but serif fonts are better for the printed page (it has to do with leading the eye on the page and reducing eye strain on the screen).
One last comment: any images set as backgrounds in your site will not print, no matter what you say in the print stylesheet.
I would add a qualifier to The Doctor's comment, saying to be cautious about making print layout too radically different than the screen layout. Someone who prints your stuff is more likely to remember where it came from if it looks similar to the site they visited.
Certainly. That's one of the considerations you have to take into account when deciding where everything should go.
Using link:
<link rel="stylesheet" href="screen.css" type="text/css">
<link rel="stylesheet" href="print.css" type="text/css" media="print">
Using @media:
<link rel="stylesheet" href="all.css" type="text/css" media="all">
(in all.css)
@media print {
/* print styles */
}
Using @import:
<link rel="stylesheet" href="style.css" type="text/css" media="all">
(in style.css)
@import url(print.css) print;
The browser may download only the stylesheets it needs using @import with a media type or the link element with an appropriate media attribute.
Setting print styles via @media means the style rules will be embedded in some other stylesheet. The only way to tell not to download a stylesheet with @media in it is ... to download it!