常见设备查询方式
2016-09-04 16:06
387 查看
常见设备查询方式
媒体查询是响应式设计的核心,它们分为显示器媒体查询、智能手机媒体查询和平板媒体查询
显示器媒体查询
显示器媒体查询是以屏幕大小为基础划分的
640px
@media screen and (max-width: 640px)
{
}
800px
@media screen and (max-width: 800px)
{
}
1024px
@media screen and (max-width: 1024px)
{
}
智能手机媒体查询
适用于大部分主流智能手机
iPhone(2G-4S)
/*Landscape Mode*/
@media screen and (max-device-width: 480px) {
}/* Portrait Mode */
@media screen and (max-device-width: 320px) {
}
iPhone 4
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio : 1.5)
{
}
iPhone5
@media only screen and (min-device-width : 320px) and(max-device-width : 568px) {
/* 样式写在这里 */
}
iPhone6
@media only screen and (min-device-width: 375px) and(max-device-width: 667px) and (orientation : portrait) {
/*iPhone 6Portrait*/
}
@media only screen and (min-device-width: 375px) and(max-device-width: 667px) and (orientation : landscape) {
/*iPhone 6landscape*/
}
@media only screen and (min-device-width: 414px) and(max-device-width: 736px) and (orientation : portrait) {
/*iPhone 6+Portrait*/
}
@media only screen and (min-device-width: 414px) and(max-device-width: 736px) and (orientation : landscape) {
/*iPhone 6+landscape*/
}
@media only screen and (max-device-width: 640px), onlyscreen and (max-device-width: 667px), only screen and (max-width: 480px){
/*iPhone 6and iPhone 6+ portrait and landscape*/
}
@media only screen and (max-device-width: 640px), onlyscreen and (max-device-width: 667px), only screen and (max-width: 480px) and(orientation : portrait){
/*iPhone 6and iPhone 6+ portrait*/
}
@media only screen and (max-device-width: 640px), onlyscreen and (max-device-width: 667px), only screen and (max-width: 480px) and(orientation : landscape){
/*iPhone 6and iPhone 6+ landscape*/
}
HTC Evo,BlackBerry Torch,HTC Thunderbolt,HD2
@media screen and (max-device-width: 480px)
{
}
平板媒体查询
这个列表会有点长
iPad
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 768px)and (orientation: portrait) {
}
iPad 2
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 768px)and (orientation: portrait) {
}
iPad 3
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 768px)and (orientation: portrait) {
}
iPad mini
@media only screen and (min-device-width : 768px) and(max-device-width : 1024px)and (-webkit-min-device-pixel-ratio: 1) {
/* 样式写在这里 */
}
Samsung Galaxy Tab 10.1
/* Landscape Mode */@media (max-device-width: 1280px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 800px)and (orientation: portrait) {
}
Motorola Xoom
/* Landscape Mode */@media (max-device-width: 1280px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 800px)and (orientation: portrait) {
}
HTC Flyer
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 600px)and (orientation: portrait) {
}
BlackBerry PlayBook
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 600px)and (orientation: portrait) {
}
HP TouchPad
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 768px)and (orientation: portrait) {
}
Lenovo Thinkpad Tablet
/* Landscape Mode */@media (max-device-width: 1280px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 800px)and (orientation: portrait) {
}
Sony Tablet S
/* Landscape Mode */@media (max-device-width: 1280px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 800px)and (orientation: portrait) {
}
T-Mobile G-Slate
/* Landscape Mode */@media (max-device-width: 1280px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 768px)and (orientation: portrait) {
}
ViewSonic ViewPad 10
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 600px)and (orientation: portrait) {
}
Dell Streak 7
/* Landscape Mode */@media (max-device-width: 800px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 480px)and (orientation: portrait) {
}
ASUS Eee Pad Transformer
/* Landscape Mode */@media (max-device-width: 1080px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 800px)and (orientation: portrait) {
}
媒体查询是响应式设计的核心,它们分为显示器媒体查询、智能手机媒体查询和平板媒体查询
显示器媒体查询
显示器媒体查询是以屏幕大小为基础划分的
640px
@media screen and (max-width: 640px)
{
}
800px
@media screen and (max-width: 800px)
{
}
1024px
@media screen and (max-width: 1024px)
{
}
智能手机媒体查询
适用于大部分主流智能手机
iPhone(2G-4S)
/*Landscape Mode*/
@media screen and (max-device-width: 480px) {
}/* Portrait Mode */
@media screen and (max-device-width: 320px) {
}
iPhone 4
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio : 1.5)
{
}
iPhone5
@media only screen and (min-device-width : 320px) and(max-device-width : 568px) {
/* 样式写在这里 */
}
iPhone6
@media only screen and (min-device-width: 375px) and(max-device-width: 667px) and (orientation : portrait) {
/*iPhone 6Portrait*/
}
@media only screen and (min-device-width: 375px) and(max-device-width: 667px) and (orientation : landscape) {
/*iPhone 6landscape*/
}
@media only screen and (min-device-width: 414px) and(max-device-width: 736px) and (orientation : portrait) {
/*iPhone 6+Portrait*/
}
@media only screen and (min-device-width: 414px) and(max-device-width: 736px) and (orientation : landscape) {
/*iPhone 6+landscape*/
}
@media only screen and (max-device-width: 640px), onlyscreen and (max-device-width: 667px), only screen and (max-width: 480px){
/*iPhone 6and iPhone 6+ portrait and landscape*/
}
@media only screen and (max-device-width: 640px), onlyscreen and (max-device-width: 667px), only screen and (max-width: 480px) and(orientation : portrait){
/*iPhone 6and iPhone 6+ portrait*/
}
@media only screen and (max-device-width: 640px), onlyscreen and (max-device-width: 667px), only screen and (max-width: 480px) and(orientation : landscape){
/*iPhone 6and iPhone 6+ landscape*/
}
HTC Evo,BlackBerry Torch,HTC Thunderbolt,HD2
@media screen and (max-device-width: 480px)
{
}
平板媒体查询
这个列表会有点长
iPad
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 768px)and (orientation: portrait) {
}
iPad 2
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 768px)and (orientation: portrait) {
}
iPad 3
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 768px)and (orientation: portrait) {
}
iPad mini
@media only screen and (min-device-width : 768px) and(max-device-width : 1024px)and (-webkit-min-device-pixel-ratio: 1) {
/* 样式写在这里 */
}
Samsung Galaxy Tab 10.1
/* Landscape Mode */@media (max-device-width: 1280px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 800px)and (orientation: portrait) {
}
Motorola Xoom
/* Landscape Mode */@media (max-device-width: 1280px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 800px)and (orientation: portrait) {
}
HTC Flyer
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 600px)and (orientation: portrait) {
}
BlackBerry PlayBook
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 600px)and (orientation: portrait) {
}
HP TouchPad
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 768px)and (orientation: portrait) {
}
Lenovo Thinkpad Tablet
/* Landscape Mode */@media (max-device-width: 1280px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 800px)and (orientation: portrait) {
}
Sony Tablet S
/* Landscape Mode */@media (max-device-width: 1280px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 800px)and (orientation: portrait) {
}
T-Mobile G-Slate
/* Landscape Mode */@media (max-device-width: 1280px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 768px)and (orientation: portrait) {
}
ViewSonic ViewPad 10
/* Landscape Mode */@media (max-device-width: 1024px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 600px)and (orientation: portrait) {
}
Dell Streak 7
/* Landscape Mode */@media (max-device-width: 800px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 480px)and (orientation: portrait) {
}
ASUS Eee Pad Transformer
/* Landscape Mode */@media (max-device-width: 1080px)and (orientation: landscape) {
}
/* Portrait Mode */@media (max-device-width: 800px)and (orientation: portrait) {
}
相关文章推荐
- HTML5中在客户端验证文件上传的大小
- html5 web数据存储
- 页面元素查找之Selectors API
- 使用ajax实现用户登录验证(升级版)
- Canvas 在高清屏下绘制图片变模糊的解决方法
- 关于前端的思考与感悟
- 新时代编辑神器:Atom
- rem : web app适配的秘密武器
- jquery高级应用之Deferred对象
- 又被事件冒泡坑了一把,这次要彻底弄懂浏览器的事件流
- 移动端点击事件全攻略,这里的坑你知多少?
- $q 实例分析 Angular 中的 Promise
- 浏览器中唤起native app || 跳转到应用商城下载
- Angular directive 实例详解
- 关于浮动与清除浮动,你应该知道的
- 数组reduce方法的高级技巧
- HTML5 语音波形显示,编辑,上传,下载
- 原生js结合html5制作小飞龙的简易跳球