2013-02-13 73 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)"