iPhone 5 screen size VS CSS media query [duplicate]

余生颓废 提交于 2019-12-03 13:44:08

问题


Possible Duplicate:
iPhone 5 CSS media query

The iPhone 5 tech spec states screen dimension of 1136 by 640

My question is this,

For landscape, ff I am to use the max-device-width of 568px refer to http://www.stephentgilbert.com/mediaqueries/#iPhone

can you explain why that works when the dimension stated on the iPhone 5 site says the width would be 1136px

I know I'm mixing up with some of the fundamentals here. I'd appreciate if you could provide me with a proper explanation and perhaps link me to relevant online resources.


回答1:


The Retina display contains twice as many pixels as the standard display, but iOS treats the resolution as the standard display for measurement and screen output. If it didn't, websites would all look very tiny and zoomed out.




回答2:


The iPhone's Retina display means the 1136x640 screen uses 568x320 virtual pixels. Each CSS pixel is made up of four physical pixels (2x2).

Since no one who says "give me a 100px wide div here" in CSS wants it to show up at half-size on a higher-resolution device like a Retina display, it doesn't use the physical pixels as CSS pixels.



来源:https://stackoverflow.com/questions/14325577/iphone-5-screen-size-vs-css-media-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!