Welcome to WebmasterWorld Guest from 188.8.131.52
Forum Moderators: not2easy
<link rel="stylesheet" href="print.css"
type="text/css" media="print" /> in the head section
and a css file with:
I then assigned class="print" to the image, but the entire page still prints.
If I understand correctly, you want to pull one specific image from a page and print it without printing any other images or text.
There are two ways that come to mind. Have the image open in a new window with a normal link saying in effect "click here to print image", or use a script to pull the specific image.
I have a script for pulling elements off a page based on id which you are welcome to. Let me know and I will post it.
I forgot that I posted the script once before. It's at [webmasterworld.com...]
[edited by: Marshall at 4:34 am (utc) on July 11, 2007]
Mod Edit: fixed link
[edited by: limbo at 11:19 am (utc) on July 11, 2007]
For example, you could assign a DIV to each element of the page with a class name of "no_print" and then put the following in your stylesheet:
Kind of clunky, but I think you get the idea.
Or if you already have class names assigned for your "media=screen" CSS file, I would suggest using those names in your print.css file to assign the visibility to, again instead of declaring the <body> tag to be hidden.
I guess it really depends on how much you have going on these pages.