7

What does media="screen" mean in the below css code?

<style type="text/css" media="screen">
2

3 Answers 3

8

The goal of the media attribute is to allow you to specify different styles for different methods of display.

Most commonly I use this to have 2 sets of styles, 1 for display (screen) and 1 for printing (print)

Normally on the "print" css I'll do things like hide buttons, strip out extraneous images, ads, etc etc. Basically, make it 8.5x11 friendly.

1
  • 1
    "screen" are the styles that your average web-browsing user is going to see. See the links that others have provided for what the various media types mean.
    – Brook
    Dec 24, 2010 at 2:41
3

There are two types, screen is the default browser view. print is for print view.

1
1

In addition to Brook's answer, the media="foo" attribute of the is equivilant to the @media foo in your CSS file

Your Answer

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

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