-4

When I print webpages, say for github and usually all the ones done in wordpress.. all the formatting goes away. Whilst other pages, For example http://webnoir.org/tutorials/forms has kept their formatting. Also, I noticed that sometimes pages with a black background prints with a white background, and other times I end up wasting half my printer's toner. Is there a way to set this using css?

zcaudate
  • 13,998
  • 7
  • 64
  • 124

2 Answers2

1

You can add conditional styles for print like this:

<link rel="stylesheet" type="text/css" media="print" href="print.css" />

Styling a page for print has its own intricacies, so it's worth reading through this ALA Article.

Jezen Thomas
  • 13,619
  • 6
  • 53
  • 91
  • It's because (as shown above) different media can use different style sheets. Styling for printing will allow the page to be altered to be printed. – Shane Jun 19 '12 at 06:02
0

Print style sheet

10 Tips for Better Print Style Sheets

"In case you’ve forgotten, here’s how to set up a print style sheet:

<link rel="stylesheet" href="print.css" type="text/css" media="print" />

The media="print" attribute ensures that users don’t see any of the styles defined in the print.css file. Some attention is required, though: if your main style sheet has no media attribute, the print style sheet will inherit its style ..."

astro boy
  • 1,410
  • 1
  • 11
  • 16