Results 1 to 3 of 3

Thread: Making a Div show when Print style sheet is in use

  1. #1
    Join Date
    Feb 2010
    Posts
    66
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Exclamation Making a Div show when Print style sheet is in use

    Hi Guys,

    As the title suggests, I am wondering if there IS a way of showing a Div (That is of course hidden) when the Print style sheet is in use (Print preview basically).

    I've tried so many ways and I can't find out how to do it.

    Thanks,

    Mark

  2. #2
    Join Date
    May 2010
    Posts
    13
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    Assuming that you already have the two style sheets in place, one for the screen display and another for print, tt's actually quite simple....

    In the screen style sheet you need to hide the div in question:
    DIV_ID_OR_CLASS { display: none; }

    And in the print style sheet, don't hide it:
    DIV_ID_OR_CLASS { }

    I frequently utilize a .printonly class, which I apply to anything that I only want to display when the site is printed. I hide this class in my screen style sheet, but don't hide it in the print style sheet. I include this as part of my base framework for all sites that I build.

    If you need more clarification than this just let me know.

  3. The Following User Says Thank You to zip222 For This Useful Post:

    lowmarklow (06-18-2010)

  4. #3
    Join Date
    Feb 2010
    Posts
    66
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default

    You, my friend, are a legend!

    It actually works when you add 'media="screen" ' to the style sheet link that features the Div's functions.

    Thanks again!

    Mark

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
  •