Windows Dev Center

EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

resolution media feature

Describes the resolution of the output device—that is, the density of the pixels.

Possible values

  • Value: <resolution>
  • Applies to: bitmap media types
  • Accepts min/max prefixes: yes

Remarks

The resolution of the device can be described in either dots per inch (dpi), dots per centimeter (dpcm), or dots per pixel (dppx). Dppx can also be described as physical pixels per CSS pixel. Using dppx is best practice.

When querying devices with non-square (rectangular) pixels:

  • Specifying min-resolution causes the least-dense dimension to be compared to the given value
  • Specifying max-resolution causes the most-dense dimension to be compared to the given value
  • Specifying resolution (without a "min-" or "max-" prefix) never matches a device with non-square pixels

Examples

The following declaration indicates that a style sheet is usable on devices with resolution greater than 2 dots per pixel (dppx).


@media (min-resolution: 2dppx) {
  ...
}

The following declaration indicates that a style sheet is usable on devices with resolution greater than 300 dpi.


@media print and (min-resolution: 300dpi) {  
  ...
}

The following declaration indicates that a style sheet is usable on devices with resolution greater than 118 dots per centimeter (dpcm).


@media print and (min-resolution: 118dpcm) {  
  ...
}

 

 

Mostrar:
© 2015 Microsoft