views:

121

answers:

2

Which way is prefer ed and why to use for print, another css file with media="print" or @media print {....} in same file?

+7  A: 

If you handle a lot of traffic, then a separate file with a separate link would be a better approach...why send that print CSS when so few people will actually need it?

Nick Craver
@nick - good point
metal-gear-solid
@Nick, can you elaborate what you mean by a separate link? Do you mean an additional `link` element, or a "Print Version" button?
Doug Neiner
I mean an additional `link` element...browsers won't fetch this unless you actually go to print.
Nick Craver
@Nick Craver - see this link http://www.456bereastreet.com/archive/201002/css_efficiency_tip_use_a_single_stylesheet_file_for_multiple_media/
metal-gear-solid
A: 

Depends on

  • how many styles your original file has
  • how many styles will be for printing only
  • how much you think the two parts will expand
  • how much traffic you get (use another page)
  • how likely printing is
  • ...

Basically, there's a lot of variables.

geowa4