Connecting Tech Pros Worldwide Help | Site Map

Print CSS Not Loading

william.oram@gmail.com
Guest
 
Posts: n/a
#1: Sep 20 '07
alt.html pointed me here, so...

I have two CSS files for print and screen. In screen.css:

..screen
{
font-weight:bold;
font-size:12px;

}

..print
{
visibility:hidden;

}

In the HTML:

<html>
<head>
<link rel="stylesheet" type="text/css" media="print"
href="print.css" /

<link rel="stylesheet" type="text/css" media="screen"
href="screen.css" />
</head>
<body>
<font class="screen">Text A</font><br><font class="print">Text B</
font>

[etc.]

In print.css, the parameters are swapped. In other words, Text B will
show on the printed page, but not on screen, and vice-versa for Text
A.

But as it stands now, it's not quite working. On "screen," it looks
OK; hidden text is hidden, shown text is shown. When printed in
Firefox 2, though, the output looks no different from on "screen." I'm
stumped why this is, and so is everyone else I've shown this to. Any
ideas?

Andreas Prilop
Guest
 
Posts: n/a
#2: Sep 20 '07

re: Print CSS Not Loading


On Thu, 20 Sep 2007, william.oram@gmail.com wrote:
Quote:
alt.html pointed me here, so...
I have two CSS files for print and screen.
.... and I point you to
news:comp.infosystems.www.authoring.stylesheets
http://groups.google.com/group/comp....ng.stylesheets
Jim Moe
Guest
 
Posts: n/a
#3: Sep 20 '07

re: Print CSS Not Loading


william.oram@gmail.com wrote:
Quote:
alt.html pointed me here, so...
>
I have two CSS files for print and screen. In screen.css:
>
You've left out too much context to give an answer.
Please provide an URL to a test case that demonstrates the problem.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Thomas Dowling
Guest
 
Posts: n/a
#4: Sep 21 '07

re: Print CSS Not Loading


william.oram@gmail.com wrote in
news:1190306485.322880.281090@n39g2000hsh.googlegr oups.com:
Quote:
>
<html>
<head>
<link rel="stylesheet" type="text/css" media="print"
href="print.css" /

One reason why it's better to give a URL than to post code. No one
here can say if that's an error in copy/paste or in your original page,
but this link element isn't closed. And unless you're doing XHTML,
just use ">" and not "/>". A validator would help you find a problem
like that immediately.


Jukka K. Korpela
Guest
 
Posts: n/a
#5: Sep 21 '07

re: Print CSS Not Loading


Scripsit Thomas Dowling:
Quote:
Quote:
><html>
><head>
><link rel="stylesheet" type="text/css" media="print"
>href="print.css" /
>
One reason why it's better to give a URL than to post code.
Indeed.
Quote:
No one
here can say if that's an error in copy/paste or in your original
page, but this link element isn't closed.
Technically, it is.
Quote:
A validator would help you find a
problem like that immediately.
No, it would not. Try it. The link element's markup is valid, HTML 4.01.

It's time for a rerun of the Saga of the Slashed Validators:
http://www.cs.tut.fi/~jkorpela/qattr.html
(even though it mainly discusses variants like <a href=../foo.html>, which
can be even more deceptive).

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Closed Thread