CSS媒体使用

时间:2013-10-04 16:57:41

标签: css media-queries

我有两个样式表,我根据屏幕宽度选择一个样式表。

<link rel="stylesheet" type="text/css" media="only screen and (min-width: 810px), only screen and (min-device-width: 810px)" href="/style/desktop.css" id="platformDependentStyle"/>
<link rel="stylesheet" type="text/css"  media="only screen and (max-width: 800px), only screen and (max-device-width: 800px)" href="/style/mobile.css" />

根据我的理解,当最小屏幕宽度至少为810px时加载第一个样式表,并且当最大屏幕屏幕宽度最多为800px时加载第二个样式表。在我的样式表中,我有这个

@media only screen and (min-width: 810px), only screen and (min-device-width: 810px){
@media only screen and (max-width: 800px), only screen and (max-device-width: 800px){

我认为我是正确的,但显然不是。出于某种原因,810px的样式应用时不应该。我错过了一些基本的东西吗?

0 个答案:

没有答案
相关问题