2013-02-13 62 views
0
<link rel="stylesheet" type="text/css" href="css/mobile.css" media="screen and (max-height: 500px)" /> 
<link rel="stylesheet" type="text/css" href="css/mobile.css" media="screen and (orientation:portrait)" /> 

我已经得到了上述媒体查询来定位纵向和窗口高度< 500个用户,有没有办法在媒体查询中使用OR将它们合并为一个链接标记?使用或在媒体查询?

回答

0

用于OR运算符。

参考:CSS media queries

所以,你的代码将是:

<link rel="stylesheet" type="text/css" href="css/mobile.css" media="screen and (max-height: 500px), screen and (orientation:portrait)" /> 
+0

非常感谢:)我会试试看 – 2013-02-13 03:24:44

0

这里的MDN article on media queries的相关章节。

只需用逗号将它们结合起来:

media="screen and (max-height: 500px), screen and (orientation: portrait)"