Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
device-width media feature

device-width media feature

Describes the width of the rendering surface of the output device. For continuous media (such as a webpage), this is the width of the screen. For paged media, this is the width of the page sheet size.

Possible values

  • Value: <length>
  • Applies to: visual and tactile media types
  • Accepts min/max prefixes: yes

Remarks

The specified length value can't be negative. For information about supported length units, see CSS Values and Units Reference.

Examples

The following declaration applies the specified rules only to screens that currently display exactly 800 horizontal pixels.


@media screen and (device-width: 800px) {
  ... 
}

 

 

Show:
© 2015 Microsoft