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断点的设置。如果大家有更好的方案,希望能在评论中分享。

CSS3教程:Responsive框架常见的Media Queries片段的更多相关文章

  1. CSS3 Media Queries 片段

    CSS3 Media Queries片段 在这里主要分成三类:移动端.PC端以及一些常见的响应式框架的Media Queries片段. 移动端Media Queries片段 iPhone5 @medi ...

  2. CSS3 媒体查询移动设备尺寸 Media Queries for Standard Devices (包括 苹果手表 apple watch)

    /* ----------- iPhone 4 and 4S ----------- */ /* Portrait and Landscape */ @media only screen and (m ...

  3. [TypeStyle] Add responsive styles using TypeStyle Media Queries

    Media queries are very important for designs that you want to work on both mobile and desktop browse ...

  4. CSS3 响应式web设计,CSS3 Media Queries

    两种方式,一种是直接在link中判断设备的尺寸,然后引用不同的css文件: <link rel="stylesheet" type="text/css" ...

  5. CSS3学习教程:Media Queries详解

    说起CSS3的新特性,就不得不提到 Media Queries . Media Queries 的引入,其作用就是允许添加表达式用以确定媒体的情况,以此来应用不同的样式表.换句话说,其允许我们在不改变 ...

  6. 【CSS3 入门教程系列】CSS3 Media Queries 实现响应式设计

    在 CSS2 中,你可以为不同的媒介设备(如屏幕.打印机)指定专用的样式表,而现在借助 CSS3 的 Media Queries 特性,可以更为有效的实现这个功能.你可以为媒介类型添加某些条件,检测设 ...

  7. HTML5实践 -- 使用CSS3 Media Queries实现响应式设计

    CSS3 Media用法介绍:http://www.w3cplus.com/content/css3-media-queries 转载请注明原创地址:http://www.cnblogs.com/so ...

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

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

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

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

随机推荐

  1. JS中的call()、apply() 以及 bind()方法用法总结

    JS中的call()方法和apply()方法用法总结  : 讲解: 调用函数,等于设置函数体内this对象的值,以扩充函数赖以运行的作用域. function add(c,d){ return thi ...

  2. Bochs调试VirtualBox生成的VDI映像

    将VDI映像转换成Bochs支持的img映像 1: vboxmanage clonehd source.vdi destination.img --format RAW 在bochsrc.txt中引用 ...

  3. yield迭代器的使用

    class Program { static void Main(string[] args) { List<Student> students = new List<Student ...

  4. Feign 系列(04)Contract 源码解析

    Feign 系列(04)Contract 源码解析 [TOC] Spring Cloud 系列目录(https://www.cnblogs.com/binarylei/p/11563952.html# ...

  5. tomcat服务器和HTTP协议

    tomcat:一个服务器的服务器软件,发布资源要用的 服务器组成: 1.服务器硬件 2.服务器软件 3.项目(一堆资源的集合) 4.资源tomcat本身是一个java程序,必须依赖jre运行eclip ...

  6. vue项目使用js-xlsx进行excel表格的导入和导出方法的简单原型封装

    前提:已经安装好 file-saver xlsx和 script-loader,如未安装,请查看 https://www.cnblogs.com/luyuefeng/p/8031597.html 新建 ...

  7. 前端实现预览ppt,word,xls,pdf文件

    1.前端实现pdf文件在线预览功能 ps:刚好工作上有这个需求,所以到处找了一下处理方案,大家有需要可以试一下这几种方案,找到合适自己的 方式一. pdf文件理论上可以在浏览器直接打开预览但是需要打开 ...

  8. 将一个压缩文件分成多个压缩文件;RAR文件分卷

    有时候需要上传压缩文件,但是限制了单个文件的大小,那我们怎么才能将一个比较大的压缩文件分割成多个压缩文件,从而符合要求的进行文件的上传呢?这里小编告诉你一个技巧. 工具/原料 电脑 winrar(一般 ...

  9. MyBatis中大于和小于号的转义写法

    mybatis 中 SQL 写在mapper.xml文件中,而xml解析 < .>.<=.>= 时会出错,这时应该使用转义写法. 方式一 < <= > > ...

  10. 谷歌浏览器控制台出现 Unchecked runtime.lastError: The message port closed before a response was received. 的报错

    错误截图: 解决:经过网上搜索说是浏览器扩展程序的问题,把那个扩展程序删除或者禁用就可以了