本文介绍了在响应式设计方面,你如何处理高分辨率手机,如Galaxy S4?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在历史上,您可以使用基于像素宽度的媒体查询来确定最终用户将获得什么显示。但是,当您使用更高分辨率的设备,如Galaxy S4(1080x1920)分辨率时,这不会/不会工作。

Historically, you'd use media queries based of pixel width to determine what display the end user will get. However, that doesn't/won't work when you are using a higher resolution device such as a Galaxy S4 (1080x1920) resolution.

如何处理?

推荐答案

什么让您认为媒体查询无效?

What makes you think media queries won't work?

显然,Galaxy S4的CSS像素比率为3.0,因此,其物理分辨率为1080x1920,其CSS分辨率仍为360x640 - 与Galaxy S3相似。

Apparently, Galaxy S4's CSS pixel ratio is 3.0, therefore, while its physical resolution is 1080x1920, its CSS resolution is still 360x640 - similar to Galaxy S3.

测试像素密度的媒体查询。他们可能会帮助您向高分辨率设备提供高分辨率图片或矢量图形。

There are also media queries that test for pixel density. They may help you to serve high-res pictures or vector graphics to hi-dpi devices.

另请参阅这篇文章:

精彩的屏幕规格数据库

这篇关于在响应式设计方面,你如何处理高分辨率手机,如Galaxy S4?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 01:14