Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Apr 2010
    Posts
    417
    Thanks
    4
    Thanked 1 Time in 1 Post

    using '@media print' prevent areas of page printing, how to do the reverse?

    Code:
    <style type="text/css">
    @media all {
      .page-break { display: none; }
    }
    
    @media print
    {
      .page-break { display: block; page-break-before: always; }
    }
    
    @media print {
    	div.screenOnly { display: none; }
    }
    @media print {
    	div.noborder { border-width: 0px;  border-style: none; }
    }
    
    </style>
    
    
    <div class="screenOnly">
    this shows on the screen
    </div>
    
    <div>this is printed</div>
    what I am wanting to do is have a reverse of this so that all the areas i contain within a given <div class="printerOnly"></div> is not shown on the screen but is ready to be printed, when the print button is pressed of course. and all the other areas are not printed.

    is this possible ?

  • #2
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    @media screen.


  •  

    Posting Permissions

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