1

I want to use some css files for both screen and print, but restrict them by width. How do I do this?

Is this correct?

<link rel="stylesheet" media="(screen, print) and (min-width: 64em)" href="large.css" />

or this?

<link rel="stylesheet" media="(screen or print) and (min-width: 64em)" href="large.css" />

or is it something else?

Don Rhummy
  • 24,730
  • 42
  • 175
  • 330
  • Have you tried them? What do your experiments show? – Turnip Apr 07 '15 at 21:32
  • @uʍopǝpısdn Neither works. This doesn't work either: `only screen and (min-width: 64em),only print and (min-width: 64em)` nor does this: `screen and (min-width: 64em),print and (min-width: 64em)` – Don Rhummy Apr 07 '15 at 21:33
  • It's [not possible to combine media types](http://www.w3.org/TR/css3-mediaqueries/#syntax). At best, you could s[eparate each media queries with a comma `,`](http://stackoverflow.com/questions/8994664/combining-css-media-queries).. – Hashem Qolami Apr 07 '15 at 21:47

1 Answers1

1

Listing the statements rather than combining them works for me...

<link rel="stylesheet" media="screen and (min-width: 64em), print and (min-width: 64em)" href="large.css" />
Turnip
  • 35,836
  • 15
  • 89
  • 111