3

I am making about 20 pages of a website all with a PDF in the middle and some ads on the sides. When someone prints the page I want the PDF to print, but not the ads on the sides. Is there a way to do this?

This image shows what I am trying to accomplish:

This is what I'm trying to accomplish

1

2 Answers 2

6

You can add specific styles for printing media.

@media print {
  .my-advertisments {
      display:none !important;
  }
}

The rules inside the @media block will be used whenever you're trying to print the page.

1
  • One of the pages is here.. cthsbc.org/2013%20Sale%20Entry%20Pages/page70.html I made6 different ID which is probably not the most efficient way but for now i thought it might work...but still the 6 divs (business cards) are still printing =/
    – Emperor12
    Jul 10, 2013 at 0:51
4

You can have custom CSS for print, so you can simply set the display to none on print:

@media print {
  #something {
       display:none;
     }
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.