Results 1 to 6 of 6

Thread: Alternate Print

  1. #1
    Join Date
    Jul 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Alternate Print

    1) Script Title: <link rel=alternate media=print href="printversion.doc">

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...printstyle.htm

    3) Describe problem: I've tried to use this on one of my pages and no matter what I do, I can't get it to work. It seems simple but I'm just not getting it right for some reason. The page is at http://www.cubpack88.org/pinewood_wisedom.htm

    Regards,

    Matthew

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    This "script" isn't supported by most browsers. It's probably only still in the archives so as not to break links.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I was using FireFox and IE 7.

    I tried the CSS type and also some script. Nothing seems to work. Is it still possible to do this?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This is a cross browser method:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="screen.css" type="text/css" media="screen">
    <link rel="stylesheet" href="print.css" type="text/css" media="print">
    </head>
    <body>
    Hi
    </body>
    </html>
    It uses two separate stylesheets, one for the screen and one for the printer. Here are examples of the stylesheets:

    screen.css
    Code:
    body {
    font:90% serif;
    color:red;
    }
    print.css
    Code:
    body {
    font:bold 200% sans-serif;
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the assist John. I'll have to do some reading on this one since I was not able to get he style sheets or css to work with frontpage when I just wanted to print out the upcoming events on our website. www.cubpack88.org

    With two styles does that mean that I have to assign a style to everything on the page or just use one style for the print and nothing for the screen since it will use the formating that is in the html code.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    See also:

    http://www.dynamicdrive.com/forums/s...712#post126712

    Where I expanded upon this. You could instead mark your on page style section(s) media="screen", ex (corrected for proper type attribute):

    Code:
    <style type="text/css" media="screen">
    
    .lcdstyle{ /*Example CSS to create LCD countdown look*/
    background-color:black;
    color:yellow;
    font: bold 18px Arial;
    padding: 3px;
    }
    
    .lcdstyle sup{ /*Example CSS to create LCD countdown look*/
    font-size: 80%
    }
    
    </style>
    But inline styles, ex:

    Code:
     . . . 024" height="96" bgcolor="#000000" style="border-collapse: collapse">
        <tr> . . .
    will apply to both print and screen.

    More importantly, you must be more precise in your print styles, as also noted in your other thread where I mentioned:

    Also the suggestion given here:

    Code:
    body {visibility:hidden;}
    .print {visibility:visible;}
    will never work because visibility is inherited - unless you have content outside the body, which is wrong to do anyway. If the entire body is hidden, nothing in it can be seen.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •