Forum Moderators: not2easy

Message Too Old, No Replies

two diff. styles - one for screen, one for print

         

Tomasm

9:04 am on Dec 6, 2006 (gmt 0)

10+ Year Member



I have the following inside header of some of my pages, so the pages don't show some useless menus when printing, but it's not valid according to W3C. Please what's wrong?

<link rel="stylesheet" type="text/css" href="style.css" media="all">
<link rel="stylesheet" type="text/css" href="print.css" media="print" />

Thanks.

jonathanellis

9:45 am on Dec 6, 2006 (gmt 0)

10+ Year Member



I think that you need to change "all" to "screen" because the "all" umbrella includes "print". More information can be found at [w3.org...]
I hope that this helps.
Jono

Robin_reala

11:13 am on Dec 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The validity error you mention is either caused by the self-closing slash at the end of your print css (if you're using HTML) or the missing self-closing slash on your screen css (if you're using XHTML).

Tomasm

12:10 pm on Dec 6, 2006 (gmt 0)

10+ Year Member



It was the self-closing slash that caused the problem - I read about this "double-styling" somewhere and based my code on the example given there I think, obviously it was not universal.

Seems fine now, however I have one other issue with the print style - when the text has more than one page, the last / first line is sometimes cut (horizontally), only top / bottom half of it or so visible. But then it's fine again on another page. Is there any trick how to make the text fit the paper? Thanks.

Tomasm

12:12 pm on Dec 6, 2006 (gmt 0)

10+ Year Member



And thanks for the hints!

jalarie

2:31 pm on Dec 6, 2006 (gmt 0)

10+ Year Member



Please be aware that the screen/print stuff does not work properly in Netscape 4. Should you care? Probably not, but you should be aware.