SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Print css

  1. #1
    SitePoint Wizard
    Join Date
    Aug 2002
    Location
    N.Ireland
    Posts
    1,046
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Print css

    I'm having trouble at the moment with a stylesheet for print. The website's banner is a background image in a div and so it doesn't print. My way around this was to insert a div which isn't displayed on screen but only for print, however it still isn't printing.

    The page is question is http://www.killyleagh.org and the html and css I've used is as follows

    on advanced.css
    #bannerprint {
    display: none;
    }
    on print.css
    #bannerprint {
    width: 306px;
    height: 51px;
    }
    html is
    <div id="bannerprint"><img src="/pics/welcome-to-killyleagh.gif" /></div>

    What am I missing here??

    Also you will note that the main text on the print preview is sitting so many pixels out to the right, leaving whitespace where the menu was. I used display:none; for the menu div in print.css but no matter what I do for the div containing the text I can't get it to align to the left, help?!?

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,797
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Hi,
    What am I missing here??
    The imported stylesheet has this declaration in it:

    Code:
    #bannerprint {
     display: none;
    }
    This is overriding the print style because you haven't specified a media for the advanced style css and it comes after the print style sheet has loaded.

    Haven't looked at the second problem yet but its probably related to the one above.

    Paul


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
  •