国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > iOS > 正文

iPhoneX 媒體查詢適配的方法教程

2020-07-26 02:22:28
字體:
供稿:網(wǎng)友

iPhone X尺寸

  • 5.8 英寸
  • 5.65 x 2.79 x 0.30 英寸

iPhone X分辨率

  • 1125 x 2436
  • 每英寸PX~458 像素

屏幕尺寸

Apple iPhone X的屏幕為5.8英寸,約為實際設(shè)備尺寸的82.9%。Apple iPhone X設(shè)備的物理尺寸為5.65 x 2.79 x 0.30英寸或(143.6 x 70.9 x 7.7 MM)。

單位顯示順序為“高x寬x厚”

屏幕像素密度和CSS像素比

“Pixel”是任何顯示器的最小單位/元素。

適合一英寸的像素總數(shù)稱為“屏幕密度”或“像素密度”,其測量為“每英寸像素數(shù)”。
像素深度限制顯示每英寸像素數(shù)取決于不同的屏幕尺寸。當(dāng)每英寸像素數(shù)增加超過屏幕尺寸限制時,顯示分辨率將增加,但實際設(shè)備寬度/高度(以像素為單位)保持不變。實際設(shè)備像素稱為設(shè)備無關(guān)像素或CSS像素比。

Apple iPhone X的密度約為458像素,實際像素密度約為153,因此它具有 3 xxhdpi的顯示像素密度。

屏幕分辨率和視口

在設(shè)備上顯示的像素總和稱為“屏幕分辨率”。并且任何設(shè)備的實際像素總和被稱為“視口”。

Apple iPhone X的物理屏幕尺寸為5.8英寸,分辨率約為1125 x 2436像素,像素密度約為458 PPI。Apple iPhone X的視口尺寸為375 x 812像素,像素比約為3。

CSS媒體查詢

Apple iPhone X媒體查詢(僅限移動設(shè)備)

復(fù)制代碼 代碼如下:
@media only screen and (min-width: 375px) and (max-width: 767px) { /* Your Styles... */ }

Apple iPhone X Min-Width媒體查詢

@media only screen and (min-width: 375px) { /* Your Styles... */ }

Apple iPhone X Min-Height媒體查詢

@media only screen and (min-height: 812px) { /* Your Styles... */ }

Apple iPhone X Landscape媒體查詢

復(fù)制代碼 代碼如下:
@media only screen and (min-width: 812px) and (orientation: landscape) { /* Your Styles... */ }

Apple iPhone X Portrait媒體查詢

復(fù)制代碼 代碼如下:
@media only screen and (min-width: 375px) and (orientation: portrait) { /* Your Styles... */ }

Apple iPhone X Retina媒體查詢

@media only screen and (-webkit-min-device-pixel-ratio: 3), only screen and ( min--moz-device-pixel-ratio: 3), only screen and (  -o-min-device-pixel-ratio: 3/1), only screen and (  min-device-pixel-ratio: 3), only screen and (    min-resolution: 458dpi), only screen and (    min-resolution: 3dppx) {  /* Retina styles here */}

視網(wǎng)膜實際上是基于設(shè)備像素比率。設(shè)備大多具有2x或3x顯示屏,因此您可以使用一般的視網(wǎng)膜媒體查詢在所有類型的設(shè)備上顯示高分辨率內(nèi)容。Retina 2x和Retina 3x媒體查詢?nèi)缦拢?/p>

Retina 2x媒體查詢

@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and ( min--moz-device-pixel-ratio: 2), only screen and (  -o-min-device-pixel-ratio: 2/1), only screen and (  min-device-pixel-ratio: 2), only screen and (    min-resolution: 192dpi), only screen and (    min-resolution: 2dppx) {  /* Retina styles here */}

Retina 3x媒體查詢

@media only screen and (-webkit-min-device-pixel-ratio: 3), only screen and ( min--moz-device-pixel-ratio: 3), only screen and (  -o-min-device-pixel-ratio: 3/1), only screen and (  min-device-pixel-ratio: 3), only screen and (    min-resolution: 384dpi), only screen and (    min-resolution: 3dppx) {  /* Retina styles here */}

補充:

/* iphone 3 */

復(fù)制代碼 代碼如下:
@media only screen and (min-device-width: 320px) and (max-device-height: 480px) and (-webkit-device-pixel-ratio: 1) { }

/* iphone 4 */

復(fù)制代碼 代碼如下:
@media only screen and (min-device-width: 320px) and (max-device-height: 480px) and (-webkit-device-pixel-ratio: 2) { }

/* iphone 5 */

復(fù)制代碼 代碼如下:
@media only screen and (min-device-width: 320px) and (max-device-height: 568px) and (-webkit-device-pixel-ratio: 2) { }

/* iphone 6, 6s */

復(fù)制代碼 代碼如下:
@media only screen and (min-device-width: 375px) and (max-device-height: 667px) and (-webkit-device-pixel-ratio: 2) { }

/* iphone 7, 8 */

復(fù)制代碼 代碼如下:
@media only screen and (min-device-width: 375px) and (max-device-height: 667px) and (-webkit-device-pixel-ratio: 2) { }

/* iphone 6+, 6s+, 7+, 8+ */

復(fù)制代碼 代碼如下:
@media only screen and (min-device-width: 414px) and (max-device-height: 736px) and (-webkit-device-pixel-ratio: 3) { }

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持武林網(wǎng)。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 台北市| 镇雄县| 资阳市| 和田市| 虞城县| 盱眙县| 井陉县| 潍坊市| 龙里县| 花莲市| 西盟| 英山县| 绥化市| 泰和县| 浦东新区| 额尔古纳市| 农安县| 新闻| 城固县| 景谷| 蕉岭县| 原平市| 灵武市| 颍上县| 宝应县| 通州市| 大悟县| 革吉县| 闽侯县| 乃东县| 家居| 志丹县| 巴中市| 江城| 中牟县| 仪陇县| 天全县| 资源县| 阿拉善盟| 定边县| 北京市|