Printing a fragment from a web page

  • Thread starter Nicolae Fieraru
  • Start date
N

Nicolae Fieraru

Hi All,

I have some pages on a web site and they respect some template, with buttons
to the top, background image, tables, etc
I would like to allow a user to print out only a part of the page, but
without the buttons and the rest of the page. I am not sure it can be done.
If anybody knows about this, please let me know.

Regards,
Nicolae
 
L

Luigi Donatello Asero

Nicolae Fieraru said:
Hi All,

I have some pages on a web site and they respect some template, with buttons
to the top, background image, tables, etc
I would like to allow a user to print out only a part of the page, but
without the buttons and the rest of the page. I am not sure it can be done.
If anybody knows about this, please let me know.

Regards,
Nicolae

You need 2 different external style sheets: one for the screen and another
for the print version which you insert in the head of your html code.
 
L

Luigi Donatello Asero

Luigi Donatello Asero said:
You need 2 different external style sheets: one for the screen and another
for the print version which you insert in the head of your html code.


You insert in the head the links to respective external relative style
sheets.
So, you have to prepare these style sheets first.
 
N

Nicolae Fieraru

Hi Luigi,

Ok, so if I have two different CSS files included in the head, what do I do
next with them?
How can the styles hide buttons?

Regards,
Nicolae
 
L

Luigi Donatello Asero

Nicolae Fieraru said:
Hi Luigi,

Ok, so if I have two different CSS files included in the head, what do I do
next with them?
How can the styles hide buttons?

Regards,
Nicolae


You want to show the buttons on the screen but not when you print the page,
don´t you?
 
A

Adrienne

Gazing into my crystal ball I observed "Nicolae Fieraru"
Hi All,

I have some pages on a web site and they respect some template, with
buttons to the top, background image, tables, etc
I would like to allow a user to print out only a part of the page, but
without the buttons and the rest of the page. I am not sure it can be
done. If anybody knows about this, please let me know.

Regards,
Nicolae
In an external stylesheet:

@media screen {
/*all your screen CSS info
..copyright {font-size:85%;}
*/
}
@media print {
/*all the stuff you do not want printed
..copyright {display:none}
*/
}
 
S

Stan McCann

Nicolae Fieraru said:
I have some pages on a web site and they respect some template, with
buttons to the top, background image, tables, etc
I would like to allow a user to print out only a part of the page,
but without the buttons and the rest of the page. I am not sure it
can be done. If anybody knows about this, please let me know.

My first thought was to let the user highlight the part they want to
print, then print it. Reading over the post again, I figure this might
be what you want: http://www.w3schools.com/css/css_mediatypes.asp
 
L

Luigi Donatello Asero

Following my previous answers on this subject, I can add that
the basic thing is that you design a div container in the style sheet for
printing in which you use the value: none for the property display, so that
the content which is within this "div" container will not be displayed in
the print version.
But it seems as there are also more refined ways which I am trying to learn.
http://www.w3.org/TR/REC-CSS1#display
http://www.w3.org/Style/Examples/007/target.html#tab1

http://www.w3.org/TR/REC-html40/types.html#h-6.13
 
L

Luigi Donatello Asero

Luigi Donatello Asero said:
Following my previous answers on this subject, I can add that
the basic thing is that you design a div container in the style sheet for
printing in which you use the value: none for the property display, so that
the content which is within this "div" container will not be displayed in
the print version.


Of course, you also have to refer to the same div class in the body of the
html code of the page which you want to print if you want the property
display: none; to work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top