Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking to CSS for media="print" ?

Status
Not open for further replies.

Mr3Putt

Programmer
May 27, 2003
320
IN
does this work? I'm having a bit of difficulty determining if it works or not...

<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/css/print.css&quot; media=&quot;print&quot;>

 
Deecee;

Flame. Unnecessary flame at that.

I've contributed more than my fair share of solutions to these forums, some simple, some very complex... I don't need a simple syntactic question answered in this way.

The changes, print- to screen-, are pretty subtle. And I'm not sure whether an over-riding class is keeping my PRINT css from working, or if my syntax is off.

I did, BTW, report your post as inappropriate. I'll check your other posts and do likewise, where fitting.
 
Mr3Putt

The text sometime you just gotta say &quot;WHAT THE @#*% !!&quot; is deecee's sig. Not a part of the response to you. If I remember my 1980's history correctly, it's a line from the Tom Cruise movie &quot;Risky Business&quot;
 
Impossible to tell, really. I'm aware of the comical context of the quote... yet unaware of deecee's intent. Still inappropriate, imnsho.

A soft answer turneth away wrath: but grievous words stir up anger.
 
Just thought I'd clear up a point. You're still entitled to your 'nsho' :)

To bring the thread back to your initial post. Try changing the print style to something readily identifiable as being different to the screen version. Say Courier text as opposed to Times New Roman. Then, as deecee mentioned, print out the page and check that the print styles come through.
 
i'd also check this: href=&quot;/css/print.css&quot; - its going back a directory then into the css directory. Just make sure you didn't mean href=&quot;css/print.css&quot; :) possible easy solution.

Also, if you are using a new enough browser print preview should be enough to see if its working.

And to see if its 'on', do something drastic in print.css

eg:
Code:
body
{
  display:none
}

does it print out basically nothing? :)
 
Okay, I suppose I shouldn't have asked.

Yes, I'm fully aware that I could set body font-size: 24pt; text-decoration:underline... and see if it's happening or not...

I just can't find the correct syntax for setting the media on a LINKED stylesheet... that's what the question was.

If my print settings are not working, of if they only appear to be not working... If it turns out that my print-style settings are being over-ridden by another CSS rule, then I might think my syntax was incorrect when it was, in fact, correct. (or some other perfectly opposite, equally difficult to explain scenario)

Just trying to eliminate potentially conflicting sources of confusion. If I could find the correct linking syntax for media-specific stylesheets, I'd be perfectly happy... whether my intended styles were operating correctly or not... at least I'd know my syntax was correct, and I could move on to remedying the problem in the sheets themselves.

Books-On-Line at the King County Library... here I come...
 
since we looked at your linked stylsheet line of code and then replied and didn't point out that the syntax was wrong, you could probably assume we all thought it was right.

If you had asked - is this the correct syntax for a linked stylesheet that is to be applied only to print media? - we might have specifically said 'yes'.

So: 'yes' that's the right syntax. [hourglass]
Code:
<link rel=&quot;stylesheet&quot; href=&quot;subFolder/stylesheetName.css&quot; type=&quot;text/css&quot; media=&quot;print&quot;>
this works for me. As I previously pointed out i'd check that leading / in your href.

If you want us to tell you more about why/how your stylesheet may or not be applied to your document you'll have to provide more info (eg, the HTML or the CSS or both). One thing to look at is the order of CSS stylesheets being specified/linked is important, as is the order of style rules within them.

Personally, I thought deecee's answer was pretty simple but answered your question and wasn't a flame .. :/ relax its only an internet forum eh? [pc1]
 
oo i just got back to this one and didnt mean any thing but if i were testing a print stylesheet i would print i out and see if my settings were applied, and if not then i would make some drastic change to the stylesheet as mentioned before and print again and if not then i would assume syntax problems.

as for my signature that kinda like my life philosophy cuz if you cannot approach life like that then you will get real miserable real fast

sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
 
Clarkin:
<my original post>
[green]does this work? I'm having a bit of difficulty determining if it works or not...

<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/css/print.css&quot; media=&quot;print&quot;>[/green]
</my original post>

...this, combined with the thread title:
<title>
[green]Linking to CSS for media=&quot;print&quot; [/green]
</title

...I thought I was being pretty clear. The post, however, does NOT specifically mention &quot;syntax&quot;. So, point taken... begrudgingly.

deecee:
Thank you for your response. Had I seen your work many times, I would, of course, have been aware of your sig. Perhaps separating your sig from the body of your posts would make it less inflamatory to those of us who know not your life philosophy.
 
i can only hope this is less offensive

<signature>
sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
</signature>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top