Printer Friendly pages

Discussion in 'Javascript' started by Someone, Jan 4, 2006.

  1. Someone

    Someone Guest

    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.
     
    Someone, Jan 4, 2006
    #1
    1. Advertising

  2. Someone

    Evertjan. Guest

    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)
     
    Evertjan., Jan 4, 2006
    #2
    1. Advertising

  3. Someone

    Someone Guest

    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:; }
     
    Someone, Jan 4, 2006
    #3
  4. Someone

    Randy Webb Guest

    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/
     
    Randy Webb, Jan 5, 2006
    #4
  5. Someone

    RobG Guest

    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
     
    RobG, Jan 5, 2006
    #5
  6. Someone

    Someone Guest

    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.
     
    Someone, Jan 5, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Klucker

    implementing a Printer Friendly .aspx Page

    John Klucker, Aug 15, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    418
    John Timney \(Microsoft MVP\)
    Aug 15, 2003
  2. Valera Simonov

    how to make asp:textbox printer-friendly?

    Valera Simonov, Oct 17, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    432
    Natty Gur
    Oct 19, 2003
  3. Ray
    Replies:
    2
    Views:
    1,156
  4. Bob Johnson

    Printer Friendly

    Bob Johnson, Jul 21, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    705
    Chris Becker
    Jul 22, 2004
  5. melinama
    Replies:
    3
    Views:
    368
    Jonathan N. Little
    Nov 9, 2006
Loading...

Share This Page