/    Sign up×
Community /Pin to ProfileBookmark

Print Friendly CSS

I understand I need to make a seperate CSS file that needs to be called when the user wants to print any page on my website, but what [U]link[/U] is used to call it. Example:

[code=php]<a href=”what link goes here to call the special css?”>Printer Friendly</a>[/code]

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@KDLADec 17.2008 — You might look into this method, which automatically switches the stylesheet when the browser's print function is activated: http://www.alistapart.com/articles/goingtoprint/
Copy linkTweet thisAlerts:
@1234567890authorDec 17.2008 — I already know how to make the website accessible through css for print. I have a link on every page on a website that says "Printer Friendly", so when the person needs to print the page they will click said link. [U]I need to know what I put in the link a href.[/U]
Copy linkTweet thisAlerts:
@KDLADec 18.2008 — You don't need a button to initiate it.<i>
</i>&lt;link rel="stylesheet" type="text/css" href="filename.css" media="print" /&gt;

in the <head> section will make it automatically load when the print function begins.

I'm assuming, though, your question really has to do with JAVASCRIPT, rather than CSS. If that's the case, you need to refer to articles having to do with a "stylesheet switcher." This involves more than a link reference, but some script to create the function, first. When you create the script, you'll need to leave out the reference to a cookie.

Reference: http://www.alistapart.com/articles/alternate/
×

Success!

Help @1234567890 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.8,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...