当前位置: 动力学知识库 > 问答 > 编程问答 >

html - How do high-DPI devices like Retina displays and 1080p phones handle pixels in media queries?

问题描述:

For example, how many pixels does the iPhone with a Retina display appear to a media query? Is it 320 pixels or 640 pixels? If it's 640 pixels, how can a website deal with different device resolutions? Is there any way to use units that are the same regardless of a screen's resolution?

网友答案:

Retina devices like the iPhone and iPad usually use 2 device pixels = 1 CSS pixel. So a media query like this:

@media all and (max-width: 320px) {
}

actually will target an iPhone (portrait), even though it is 640 device pixels wide.

分享给朋友:
您可能感兴趣的文章:
随机阅读: