如何寫點響應式布局的代碼?
首先,我們把里面的內容寫出來。
<body>
<div id="xiangyingshi"></div>
</body>
然后,再寫響應式布局的適配代碼
@media (device-height:480px) and (-webkit-min-device-pixel-ratio:2){/<strong>* 兼容iphone4/4s */</strong>
.class{}
}
@media (device-height:568px) and (-webkit-min-device-pixel-ratio:2){/<strong>* 兼容iphone5 */</strong>
.class{}
}
@media (device-height:667px) and (-webkit-min-device-pixel-ratio:2){<strong>/* 兼容iphone6 */</strong>
.class{}
}
@media (device-height:736px) and (-webkit-min-device-pixel-ratio:2){<strong>/* 兼容iphone6 Plus */</strong>
.class{}
}