-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
移动端适配 #27
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
看了这段代码比较困惑,所以查了下资料
dpr(设备像素比) = 物理像素/ 设备独立像素(dip) iphone6的物理像素是750 dpr是2 所以dip是375
meta中的scale的 scale = dip(设备独立像素)/ css像素 将scale设置成1/dpr (1/2) 设备独立像素是375 可以得出此时 屏幕的css像素是750 介样的话 屏幕上的css像素是750 物理像素750 设备独立像素是375
物理像素和css像素相等(物理像素是显示颜色的最小单元) , 这就是为啥要给scale设置成1/dpr
参考:
https://www.quirksmode.org/mobile/viewports.html
https://www.quirksmode.org/mobile/viewports2.html
https://www.quirksmode.org/mobile/metaviewport/#t10
amfe/article#17
http://www.css88.com/archives/5975#more-5975
The text was updated successfully, but these errors were encountered: