SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist mumford1's Avatar
    Join Date
    Sep 2002
    Location
    UK
    Posts
    569
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Print Stylesheets

    Hi

    I need to be able to print just the basic format of the site i am working on, if you go to http://www.search-engine-professionals.co.uk you can see what it looks like.

    When the user prints i want to get rid of the header, the left content and the right content, but when i take these classes out of the stylesheet, you are still left with the navigation text and all images that where in the left content etc, is there any way around this.

    thanks for any help.

  2. #2
    .net install meltdown
    Join Date
    May 2001
    Location
    View Ridge
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use two stylesheets: one for the screen & one for printing. In the print stylesheet, set all the <div>s you don't want to print to display:none.

    Then, in the <head> add another <link> to the print stylesheet setting the media type for each stylesheet like so:
    Code:
    <link rel="stylesheet" href="style.css" media="screen" type="text/css" />
    <link rel="stylesheet" href="style_print.css" media="print" type="text/css" />
    I think this can be done using @import as well, though I can't help you one that one.

  3. #3
    SitePoint Zealot cokeman's Avatar
    Join Date
    Dec 2000
    Location
    So. California
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had just asked a question like that recently and http://www.alistapart.com/stories/goingtoprint/ was where I was directed to go. Great resource there.


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
  •