CSS3 Media Queries片段
在这里主要分成三类:移动端、PC端以及一些常见的响应式框架的Media Queries片段。
移动端Media Queries片段
iPhone5
@media screen and (device-aspect-ratio: 40/71) {} 或者: @media screen and (device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2){}
iPhone 5 In Portrait & Landscape
@media only screen and (min-device-width : 320px) and (max-device-width : 568px){ // CSS Style }
iPhone 5 In Landscape
@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape){ // CSS Style }
iPhone 5 In Portrait
@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : portrait){ // CSS Style }
iPone4
@media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) {}
iPhone 3G
@media screen and (device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1){}
iPhone
@media screen and (max-device-width: 480px) {} @media screen and (max-device-width: 320px) {}
Blackberry Torch
@media screen and (max-device-width: 480px) {}
Samsung S3
@media only screen and (-webkit-device-pixel-ratio: 2) {}
Google Nexus 7
@media screen and (device-width: 600px) and (device-height: 905px) and (-webkit-min-device-pixel-ratio: 1.331) and (-webkit-max-device-pixel-ratio: 1.332) {}
Samsung Galaxy S3
@media only screen and (-webkit-device-pixel-ratio: 2) {}
Samsung Galaxy S2
@media screen and (device-width: 320px) and (device-height: 533px) and (-webkit-device-pixel-ratio: 1.5) {}
Galaxy Tab 10.1
@media (max-device-width: 1280px) and (orientation: landscape) {} @media (max-device-width: 800px) and (orientation: portrait) {}
iPad In Portrait & Landscape
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px){ // CSS Styles }
iPad In Landscape
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape){ // CSS Styles }
iPad In Portrait
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait){ // CSS Styles }
Retina iPad In Portrait & Landscape
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (-webkit-min-device-pixel-ratio: 2){ // CSS Styles }
Retina iPad in landscape
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio: 2){ // CSS Styles }
Retina iPad in portrait
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio: 2){ // CSS Styles }
iPad Mini In Portrait & Landscape
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (-webkit-min-device-pixel-ratio: 1){ // CSS Style }
iPad Mini In Landscape
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio: 1){ // CSS Style }
iPad Mini In Portrait
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio: 1) { // CSS Style }
桌面端
320px
@media screen and (max-width: 320px) {}
640px
@media screen and (max-width: 640px) {}
800px
@media screen and (max-width: 800px) {}
1024px
@media screen and (max-width: 1024px) {}
1028px
@media screen and (max-width: 1028px) {}
除了上面的常见Media Queries片段之外,下面的网站还提供了一些其他的片段:

框架Media Queries片段
Boilerplate
@media only screen and (min-width : 320px) and (max-width : 480px) { } @media only screen and (min-width : 321px) { } @media only screen and (max-width : 320px) { } @media only screen and (min-width : 768px) and (max-width : 1024px) { } @media only screen and (min-width : 768px) and (max-width : 1024px) and (orientation : landscape) { } @media only screen and (min-width : 768px) and (max-width : 1024px) and (orientation : portrait) { } @media only screen and (min-width : 1224px) { } @media only screen and (min-width : 1824px) { } @media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) { }
Bootstrap的Media Queries
@media (min-width: 1200px) { ... } @media (min-width: 768px) and (max-width: 979px) { ... } @media (max-width: 767px) { ... } @media (max-width: 480px) { ... }
Foundation的Media Queries
@media only screen { } @media only screen and (min-width: 768px) {} @media only screen and (min-width: 1280px) {} @media only screen and (min-width: 1440px) {} @media only screen and (orientation: landscape) {} @media only screen and (orientation: portrait) {}
Skeleton的Media Queries
@media only screen and (max-width: 959px) {} @media only screen and (min-width: 768px) and (max-width: 959px) {} @media only screen and (max-width: 767px) {} @media only screen and (min-width: 480px) and (max-width: 767px) {} @media only screen and (max-width: 479px) {}
FRAMELESS的Media Queries
@media screen and (max-width: 16.875em){} @media screen and (min-width: 32.5em) and (max-width: 37.4375em), screen and (min-width: 45em) and (max-width: 56.9375em), screen and (min-width: 77.5em) and (max-width: 102.4375em), screen and (min-width: 135em){} @media screen and (min-width: 102.5em) and (max-width: 117.9375em), screen and (min-width: 150em){} @media screen and (min-width: 15em){} @media screen and (min-width: 30em){} @media screen and (min-width: 37.5em){} @media screen and (min-width: 57em){} @media screen and (min-width: 57em) and (max-width: 117.9375em){} @media screen and (min-width: 118em){}
Susy的Media Queries
@media (min-width: 29em) {} @media (min-width: 30em) and (max-width: 60em) {} @media (min-width: 119em) {} @media (min-width: 33.75em) and (max-width: 67.5em) {} @media (min-width: 33.75em) and (max-width: 67.5em) {}
Less Framework 4
@media only screen and (min-width: 768px) and (max-width: 991px) {} @media only screen and (max-width: 767px) {} @media only screen and (min-width: 480px) and (max-width: 767px) {}
Golden Grid System的Media Queries
@media screen and (min-width: 40em) {} @media screen and (min-width: 45em) {} @media screen and (min-width: 55.5em) {} @media screen and (min-width: 61.5em) {} @media screen and (min-width: 75em) {} @media screen and (min-width: 87em) {} @media screen and (min-width: 105em) {} @media screen and (min-width: 117em) {} @media screen and (min-width: 130em) {}
Fluid baseline的Media Queries
@media only screen and (min-width: 320px) {} @media only screen and (min-width: 480px) {} @media only screen and (min-width: 600px) {} @media only screen and (min-width: 768px) {} @media only screen and (min-width: 1024px) {} @media only screen and (min-width: 1280px) {} @media only screen and (min-width: 1400px) {}
320andUP
@media only screen and (min-width: 480px) { } @media only screen and (min-width: 600px) { } @media only screen and (min-width: 768px) { } @media only screen and (min-width: 992px) { } @media only screen and (min-width: 1382px) { } @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { }
Gridless
@media only screen and (min-width: 480px) { } @media only screen and (min-width: 768px) { } @media only screen and (min-width: 1024px) { }
TotanTHEMES
@media only screen and (max-width: 959px) {} @media only screen and (min-width: 768px) and (max-width: 989px) {} @media only screen and (max-width: 767px) {} @media only screen and (min-width: 480px) and (max-width: 767px) {} @media only screen and (max-width: 479px) {}
Responsive Grid System
@media (max-width: 480px) {} @media (min-width: 480px) and (max-width: 768px) {} @media (min-width: 768px) {} @media (min-width: 1024px) {} @media (min-width: 1200px) {}
本文搜集的是Media Queries在各种设备下的代码片段,希望这些片段能帮大家更好的理解Responsive断点的设置。如果大家有更好的方案,希望能在评论中分享。

转载于:https://www.cnblogs.com/Better-Me/p/3478974.html

CSS3教程:Responsive框架常见的Media Queries片段相关推荐

  1. CSS:媒体查询 CSS3 Media Queries

    定义和使用 使用 @media 查询,你可以针对不同的媒体类型定义不同的样式. @media 可以针对不同的屏幕尺寸设置不同的样式,特别是如果你需要设置设计响应式的页面,@media 是非常有用的. ...

  2. CSS3 Media Queries 详细介绍与使用方法,Responsive Web Design 必备技术, 响应式设计

    上一篇我们介绍了Responsive Web Design之后,这次要来详细介绍CSS3 Media Queries了. 在上一篇中,我们提到Responsive Web Desig n的实作方式有大 ...

  3. CSS之Responsive设计和CSS3 Media Queries的结合

    随着高科技的发展,现在我们浏览网页不在局限于PC机上了,用户可使用上网的设备是越来越多的品种:手机.小笔记本.iPad.Playbook,以及PC机,而且PC机的显展大小各不一致.这样一来不同的屏幕分 ...

  4. css3的媒体查询(Media Queries)

    css3的媒体查询(Media Queries) 我今天就总结一下响应式设计的核心CSS技术Media(媒体查询器)的用法. 先看一个简单的例子: <link rel="stylesh ...

  5. CSS3的媒体查询(Media Queries)与移动设备显示尺寸大全

    文章目录 媒体查询介绍 Media Queries具体使用 一.最大宽度Max Width 二.最小宽度Min Width 三.多个Media Queries使用 四.设备屏幕的输出宽度Device ...

  6. CSS3 Media Queries 实现网页自适应

    文章转载自:爱思资源网http://www.aseoe.com/show-10-261-1.html 导语 接下来会展示如何运用 HTML5 和 CSS3 来设计一个自适应网页.当今银屏分辨率从 32 ...

  7. CSS3 Media Queries:移动 Web 的完美开端

    移动时代,是任何 Web 设计与开发者都不能忽视的一个时代,总有一天,你设计的东西将被显示在两种屏幕上,桌面大屏幕和移动小屏幕,如何让同一个网站同时适应完全不同的两种尺寸的屏幕,这是一个很久以来都没有 ...

  8. CSS3 Media Queries详细介绍和使用实例

    Media Queries直译过来就是"媒体查询",在我们平时的Web页面中head部分常看到这样的一段代码: 复制代码 代码如下: <link href="css ...

  9. 浅谈CSS3 响应式布局--Media Queries

    CSS3 Media Queries , CSS3媒体查询.使用 @media 查询,你可以针对不同的媒体类型定义不同的样式:也可以针对不同的屏幕尺寸设置不同的样式:当重置浏览器大小的过程中,页面也会 ...

最新文章

  1. usb 驱动修复_您可以修复物理损坏的USB驱动器吗?
  2. 如何在 C# 中使用 Exceptionless
  3. linux程序已经在后台运行冻结了_如何使程序在Linux后台运行
  4. MD5加密方式-工具类
  5. 奥运会上刷新亚洲记录的211高校副教授苏炳添论文被扒出,网友:膜拜大神!...
  6. java上传kafka的方法_哪种方法是将所有数据从Kafka主题复制到接收器(文件或Hive表)的最佳方法?...
  7. 无线电波的入侵第1部分——无线电频率基础与理论
  8. BC 2015在百度之星程序设计大赛 - 预赛(1)(矩形区域-旋转卡)
  9. Netty实战九之单元测试
  10. Spring 静态代理+JDK动态代理和CGLIB动态代理
  11. C++ 实现matlab高斯滤波函数imgaussfilt
  12. 泛微云桥任意文件读取漏洞复现[09/18]
  13. 【硬件木马项目】第二篇:硬件木马检测方法的种类及原理
  14. C盘空间不足,UE4的deriveddatacache目录位置修改
  15. MTK平台 SIM双卡改成单卡修改
  16. 单工通信、半双工通信和全双工通信之间有什么区别。
  17. 增长黑盒 | 谈到“增长”,我们到底该研究什么?
  18. 使用前嗅ForeSpider采集需要登陆的网页内容
  19. 8/21 牛客补题+cf思维+tarjan
  20. WorkNC刀柄轮廓导入方法

热门文章

  1. 关于latex简历几个非常有用的命令
  2. 鼎捷t100架构_鼎捷T100发布 打造“互联网+制造”企业智能互联云平台
  3. 【玩转python】python实现不同温度之间的互相转换(附源码)
  4. 502 Bad Gateway 错误的可能原因
  5. Java思考题——给定一个年份,让你判断出来该年对应天干地支纪年法的名称及生肖(三种方法实现)
  6. 考研倒计时自律神器计划便签
  7. 小程序投标书_快来学习招投标小技巧!中标率提高50%(建议收藏)
  8. cucumber介绍及简单使用
  9. 基于stm32c8t6移植FreeRTOS问题汇总
  10. 基于CC2530的温湿度传感器和基于C#的应用界面设计