0

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

<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 的样式在不应该应用的时候被应用。我错过了一些基本的东西吗?

4

0 回答 0