2014-10-10 54 views
1

我正在將樣式應用於一組非常特定的寬度/高度組合。結合CSS中的特定媒體查詢

目前我有兩個連擊分開,這樣,但是我有一些其他的組合添加過多:

@media only screen 
    and (width: 468px) 
    and (height : 60px) { 

    .header { 
     height:100%; 
    } 
} 

@media only screen 
    and (width: 728px) 
    and (height : 90px) { 

    .header { 
     height:100%; 
} 

我失敗嘗試將這些組合成一個媒體查詢。可能嗎?

非常感謝。

回答

1

你可以試試這個:

@media 
    only screen and (width: 468px) and (height : 60px), 
    only screen and (width: 728px) and (height : 90px) { 

    .header { 
     height:100%; 
    } 
} 
+0

這完美地工作,謝謝。我試過使用,作爲一個OR語句,但我想沒有它與其他元素正確的順序。 – Alexander 2014-10-10 16:34:16