View Full Version : Need help with Alternate Document Print

05-03-2006, 06:45 PM
I can get this to work in IE but not FF. The script is supposed to be cross browser friendly.

DD's link:

My page:

Any ideas?

05-03-2006, 09:27 PM
I can get this to work in IE but not FF. The script is supposed to be cross browser friendly.

Isn't. Try Google for "media=print". The top result should be the w3c's page on this which, though accurate, can be a bit involved. This Link:


Looked fairly basic and useful. There are different ways to do this that are mostly cross browser. The method outlined at DD here is IE specific, even though it says otherwise.

05-04-2006, 09:31 AM
Thank you for your reply.

Its still doesn't work in FF though. I've searched the net extensively and it seems others are also having this issue as well.

I tried the link you offered and every variation of the tag possible and its just not an option at this time.

I'm now using javascript.

Thank you again and take care.

05-04-2006, 09:45 AM
Javascript is unreliable. Many folks have it turned off. This (taken loosely from that link) worked in IE6, FF1.5.0.3 and Opera8.54:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">

@media print {
BODY {font-size: 20pt; line-height: 120%; background: white;color:black;}
@media screen {
BODY {font-size: medium; line-height: 1em; background: silver;color:red}


I'm fairly sure the other methods outlined will as well.

05-04-2006, 10:15 AM
Its still doesn't work in FF though.Print style sheets do work in a large number of browsers. If you're having problems, then you'll have to post a link to an example. At a guess, there's a specificity issue, but guessing is a waste of time.

Incidentally, the 'Alternate Document' example you referenced at the start of this thread is due to be removed from DynamicDrive.