By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,852 Members | 2,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,852 IT Pros & Developers. It's quick & easy.

Printer Friendly pages

P: n/a
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.
Jan 4 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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:;

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 4 '06 #2

P: n/a
On 04 Jan 2006 23:17:36 GMT, Evertjan. wrote:
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:;


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

body { display:none; }
..print { display:; }
Jan 4 '06 #3

P: n/a
Someone said the following on 1/4/2006 6:34 PM:
On 04 Jan 2006 23:17:36 GMT, Evertjan. wrote:

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;
}


try:

display:none;

and

display:;

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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 5 '06 #4

P: n/a
Someone wrote:
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
[...]
--
Rob
Jan 5 '06 #5

P: n/a
On Wed, 04 Jan 2006 19:31:08 -0500, Randy Webb wrote:
Someone said the following on 1/4/2006 6:34 PM:
On 04 Jan 2006 23:17:36 GMT, Evertjan. wrote:

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;
}

try:

display:none;

and

display:;

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.


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.
Jan 5 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.