最小宽度和最大宽度的CSS媒体查询 [英] Min-width and Max-width css media queries

查看:1152
本文介绍了最小宽度和最大宽度的CSS媒体查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<link href="css/mobile-large.css" media="all and (min-width: 481px) and (max-width: 760px)" rel="stylesheet" type="text/css" />

不应该在代码行中加载样式表mobile-large.css当使用宽度为720px的三星Galaxy Nexus?然而,它不是这样的原因,我该如何解决它?

Shouldn't that line of code do so that the stylesheet "mobile-large.css" be loaded when using a Samsung Galaxy Nexus with 720px in width? However it doesn't so what is the reason and how do I fix it?

我也使用这个:

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />


推荐答案

也许您必须定义设备宽度而不是简单的宽度。这样写:

May be you have to define device-width instead of simple width. Write like this:

<link href="css/mobile-large.css" media="all and (min-device-width: 481px) and (max-device-width: 760px)" rel="stylesheet" type="text/css" />

这篇关于最小宽度和最大宽度的CSS媒体查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆