Go Back   SitePoint Forums > Forum Index > Design Your Site > Web Page Design > CSS
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Jul 21, 2003, 09:31   #1
HardinComp
SitePoint Zealot
 
HardinComp's Avatar
 
Join Date: May 2003
Location: Boston, MA
Posts: 171
Question Print friendly CSS?

I don't know if this is the right forum, but where can I find information on creating a print-friendly version of my pages without creating a seperate file for each file? I love the way SP does it and I want to do something like it.
HardinComp is offline   Reply With Quote
Old Jul 21, 2003, 09:49   #2
redemption
SitePoint Wizard
silver trophy
 
redemption's Avatar
 
Join Date: Sep 2001
Location: Singapore
Posts: 5,332
A List Apart had an article on print stylesheets last year here
redemption is offline   Reply With Quote
Old Jul 21, 2003, 10:28   #3
HardinComp
SitePoint Zealot
 
HardinComp's Avatar
 
Join Date: May 2003
Location: Boston, MA
Posts: 171
I know how to do CSS (I won't do a site without them). What I'm wondering about is how to give my users a link to click that will reopen the page with a printer-friendly stylesheet rather than having to having to duplicate all the pages. But thanks for the link.
HardinComp is offline   Reply With Quote
Old Jul 21, 2003, 10:40   #4
redemption
SitePoint Wizard
silver trophy
 
redemption's Avatar
 
Join Date: Sep 2001
Location: Singapore
Posts: 5,332
You don't have to duplicate all the pages. You just need to define, at worst, a print stylesheet for each page. That is unlikely though, since most pages would be similar and they can use the same stylesheet. That's what the article was about - defining a print stylesheet that prints nicely without having the user click a 'Printer-friendly' link at all.

But yes I've mistaken your intention.

If you want a printer-friendly page without duplicating, you could use a server-side script to change the stylesheet on the fly when the user clicks the link to the printer-friendly page.
redemption is offline   Reply With Quote
Old Jul 21, 2003, 11:25   #5
vgarcia
☆★☆★
silver trophy
 
vgarcia's Avatar
 
Join Date: Jan 2002
Location: in transition
Posts: 21,481
Quote:
Originally Posted by redemption
If you want a printer-friendly page without duplicating, you could use a server-side script to change the stylesheet on the fly when the user clicks the link to the printer-friendly page.
Wouldn't directing them to the "Print Preview" option in their browser be a better way if you're using a print stylesheet? At least it would cut down on your work as a developer .
vgarcia is offline   Reply With Quote
Old Jul 21, 2003, 11:37   #6
redemption
SitePoint Wizard
silver trophy
 
redemption's Avatar
 
Join Date: Sep 2001
Location: Singapore
Posts: 5,332
Quote:
Originally Posted by vgarcia
Wouldn't directing them to the "Print Preview" option in their browser be a better way if you're using a print stylesheet?
Yes that's exactly the way I'd thought you could use by pointing to that ALA article. Perhaps you could consider this instead as Vinnie had said?
redemption is offline   Reply With Quote
Old Jul 21, 2003, 11:47   #7
Paul_C
Rabble Rouser
bronze trophy
 
Join Date: Jan 2003
Location: Mountain View, CA
Posts: 431
Is there javascript that will activate Print Preview? That way you could use just the print css and still give a "link" to a printer-friendly page.
Paul_C is offline   Reply With Quote
Old Jul 21, 2003, 11:57   #8
HardinComp
SitePoint Zealot
 
HardinComp's Avatar
 
Join Date: May 2003
Location: Boston, MA
Posts: 171
Quote:
Originally Posted by vgarcia
Wouldn't directing them to the "Print Preview" option in their browser be a better way if you're using a print stylesheet? At least it would cut down on your work as a developer [img]images/smilies/biggrin.gif[/img].
Unfortunately my pages (starting at http://HardinComp.port5.com/Revelation/) are too wide for standard printing. What I want to do is use a separate CSS for printing that will reduce them to page width.
HardinComp is offline   Reply With Quote
Old Jul 21, 2003, 11:59   #9
HardinComp
SitePoint Zealot
 
HardinComp's Avatar
 
Join Date: May 2003
Location: Boston, MA
Posts: 171
Ahh. I just looked more closely at the article. I do believe that will do the job. Thanks.
HardinComp is offline   Reply With Quote
Old Jul 21, 2003, 13:05   #10
vgarcia
☆★☆★
silver trophy
 
vgarcia's Avatar
 
Join Date: Jan 2002
Location: in transition
Posts: 21,481
Quote:
Originally Posted by HardinComp
Ahh. I just looked more closely at the article. I do believe that will do the job. Thanks.
No problem. I take advantage of anything that involves less work on my end, hence the strong suggestion .
vgarcia is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 01:45.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved