Printer Friendly pages

S

Someone

I have a printer friendly page where I am using a stylesheet and the
attribute and value - media="print" - as below:

<link href="../page_print.css" rel="stylesheet" type="text/css"
media="print">

It works fine except, that the text that I want printed ends up in the
middle of the screen because elements made invisible in the stylesheet
still effect the text's positioning. Stylesheet is like this:

body {visibility:hidden;}

..print {
visibility:visible;
position: absolute;
top: 10px;
left: 10px;
}

As shown I have tried using absolute positioning for the printer style
sheet to force the text further up, but the text at the bottom of the page
then gets split over two pages. Is there a solution? I am using IE 6.
 
E

Evertjan.

Someone wrote on 05 jan 2006 in comp.lang.javascript:
I have a printer friendly page where I am using a stylesheet and the
attribute and value - media="print" - as below:

<link href="../page_print.css" rel="stylesheet" type="text/css"
media="print">

It works fine except, that the text that I want printed ends up in the
middle of the screen because elements made invisible in the stylesheet
still effect the text's positioning. Stylesheet is like this:

body {visibility:hidden;}

.print {
visibility:visible;
position: absolute;
top: 10px;
left: 10px;
}

As shown I have tried using absolute positioning for the printer style
sheet to force the text further up, but the text at the bottom of the
page then gets split over two pages. Is there a solution? I am using
IE 6.

try:

display:none;

and

display:;
 
S

Someone

Someone wrote on 05 jan 2006 in comp.lang.javascript:


try:

display:none;

and

display:;

The following causes nothing to be displayed. i.e.

body { display:none; }
..print { display:; }
 
R

Randy Webb

Someone said the following on 1/4/2006 6:34 PM:
The following causes nothing to be displayed. i.e.

body { display:none; }
..print { display:; }

Instead of display:; you should use display: block; or something close
to it. The point was that instead of using visibility you should use
display CSS to get the effects you want.
 
R

RobG

Someone said:
I have a printer friendly page where I am using a stylesheet and the
attribute and value - media="print" - as below:

<link href="../page_print.css" rel="stylesheet" type="text/css"
media="print">

It works fine except, that the text that I want printed ends up in the
middle of the screen because elements made invisible in the stylesheet
still effect the text's positioning. Stylesheet is like this:

This is a CSS question, not JavaScript. You should ask in a relevant
forum, try:

comp.infosystems.www.authoring.stylesheets


[...]
 
S

Someone

Someone said the following on 1/4/2006 6:34 PM:

Instead of display:; you should use display: block; or something close
to it. The point was that instead of using visibility you should use
display CSS to get the effects you want.

Ok, but I have now tried block and table for display. I want to hide
everything in the body tag and then ensure a single table that contains
text is printed. I am finding this very frustrating as I am not
experienced with CSS. Would it be possible for someone to post an example
of code that does the above?

Thanks.
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top