HTML5/CSS3

响应式设计之@media screen针对不同移动设备

智言 2015年05月07日 阅读(4437) 0

device-pixel-ratio:定义输入设备屏幕的可视宽度与可见高度比率。
device-width:输入设备屏幕的可视宽度。
orientation :屏幕横竖屏定向。landscape 是横向,portrait 是纵向【ipad 相反】

/* iPhone 4 ———– */
@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
/* Styles */
}

/* iPads (portrait) ———– */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait) {
/* Styles */
}
/* Smartphones (portrait and landscape) ———– */

@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ———– */

@media only screen
and (min-width : 321px) {
/* Styles */
}
/* Smartphones (portrait) ———– */

@media only screen
and (max-width : 320px) {
/* Styles */
}
/* iPads (portrait and landscape) ———– */

@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
/* Styles */
}
/* iPads (landscape) ———– */

@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
/* Styles */
}
/* iPads (portrait) ———– */

@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait) {
/* Styles */
}
/* Desktops and laptops ———– */

@media only screen
and (min-width : 1224px) {
/* Styles */
}
/* Large screens ———– */

@media only screen
and (min-width : 1824px) {
/* Styles */
}
/* iPhone 4 ———– */

@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
/* Styles */
}

原文地址:http://www.frontopen.com/2728.html

 

智言

业务开发请联系QQ:5679361

评论 抢沙发

评论前必须登录!

 


如果你觉得本站内容对你有所帮助,比如提升你对编程方面的认识,你可以通过上面的二维码请博主喝杯咖啡,安好。

WEB前端开发部落(公众号:webapp_club)

群列表

前端初级学习群:初级Web前端学习群(后期为支付入群)
PHP初级学习群:PHP(MySQL)学习交流群
QQ群仅作为相关领域讨论平台,均提供高质量问题交流,禁止闲聊,无法接受的朋友请勿加群!
进群需要通过这里获取进群码才能进群哦!

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏