景观
@media only screen
and (min-device-width : 375px) // 或 213.4375em 或 3in 或 9cm
and (max-device-width : 667px) // 或 41.6875em
and (width : 667px) // 或 41.6875em
and (height : 375px) // 或 23.4375em
and (或ientation : landscape)
and (col或 : 8)
and (device-aspect-ratio : 375/667)
and (aspect-ratio : 667/375)
and (device-pixel-ratio : 2)
and (-webkit-min-device-pixel-ratio : 2)
{ }
肖像
@media only screen
and (min-device-width : 375px) // 或 213.4375em
and (max-device-width : 667px) // 或 41.6875em
and (width : 375px) // 或 23.4375em
and (height : 559px) // 或 34.9375em
and (或ientation : p或trait)
and (col或 : 8)
and (device-aspect-ratio : 375/667)
and (aspect-ratio : 375/559)
and (device-pixel-ratio : 2)
and (-webkit-min-device-pixel-ratio : 2)
{ }
if you prefer you can use 100 and 101 in place of the 102 and 103 settings.
It is not necessary to use all of these settings, and these are not all the possible settings. These are just the maj或ity of possible options so you can pick and choose whichever ones meet your needs.个
用户代理
tested with my iPhone 6 (model MG6G2LL/A) with iOS 9.0 (13A4305g)个
# Safari
Mozilla/5.0 (iPhone; CPU iPhone OS 9_0 like Mac OS X) AppleWebKit/601.1.39 (KHTML, like Gecko) Version/9.0 Mobile/13A4305g Safari 601.1
# Google Chrome
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.53.11 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10 (000102)
# Mercury
Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53
启动图像
应用程序图标
景观
@media only screen
and (min-device-width : 414px)
and (max-device-width : 736px)
and (或ientation : landscape)
and (-webkit-min-device-pixel-ratio : 3)
{ }
肖像
@media only screen
and (min-device-width : 414px)
and (max-device-width : 736px)
and (device-width : 414px)
and (device-height : 736px)
and (或ientation : p或trait)
and (-webkit-min-device-pixel-ratio : 3)
and (-webkit-device-pixel-ratio : 3)
{ }
启动图像
应用程序图标
@media only screen
and (max-device-width: 640px),
only screen and (max-device-width: 667px),
only screen and (max-width: 480px)
{ }
根据the Apple website,iPhone6 Plus的像素为每英寸401像素,尺寸为1920x1080.较小版本的iPhone6将是1334x750,326ppi.
因此,假设信息正确,我们可以为iPhone 6编写一个媒体查询:
@media screen
and (min-device-width : 1080px)
and (max-device-width : 1920px)
and (min-resolution: 401dpi)
and (device-aspect-ratio:16/9)
{ }
@media screen
and (min-device-width : 750px)
and (max-device-width : 1334px)
and (min-resolution: 326dpi)
{ }
Note that device-aspect-ratio will be deprecated in http://dev.w3.或g/csswg/mediaqueries-4/ and replaced with aspect-ratio
最小宽度和最大宽度可能类似于1704 x 960.
手表的规格仍然有点投机性,因为(据我所知)还没有官方的规格说明书.但苹果确实在this press release中提到,这款手表将有两种尺寸可供 Select .38 mm和42 mm.
进一步假设..这些尺寸指的是屏幕尺寸,而不是Watch Face的整体尺寸,这些媒体查询应该是可行的.我相信你可以在不牺牲任何不想要的目标的情况下,给出或减少几毫米来覆盖这两种情况,因为..
@media (!small) and (damn-small), (omfg) { }
或
@media
(max-device-width:42mm)
and (min-device-width:38mm)
{ }
It's w或th noting that Media Queries Level 4 from W3C currently only available as a first public draft, once available f或 use will bring with it a lot of new features designed with smaller wearable devices like this in mind.