2012-10-23 21 views
2

即時通訊設法將視網膜背景圖像放入某些元素,並且即時通過實際獲取這些媒體查詢來工作。崇高的文本不會語法突出顯示它們,所以我很確定這個堆棧被破壞,但我不知道該怎麼做。幫助pelase?媒體查詢像素比例不起作用

@media 
only screen and (-webkit-min-device-pixel-ratio: 1.5), 
only screen and ( min--moz-device-pixel-ratio: 1.5), 
only screen and ( -o-min-device-pixel-ratio: 1.5/1), 
only screen and (  min-device-pixel-ratio: 1.5){ 
} 

回答

0

只有一個像素投喂量應適用於它的工作。想想看,當-webkit-min-device-pixel-ratio將爲1.5時,它不會用於-o-min-device-pixel-ratio。我們只有「和」規則。如果所有規則一次都不是真的,則不會應用該條件。

試試這個代碼:

only screen and (min-device-pixel-ratio: 1.5){ 
} 

對於其他規則,單獨申請他們每次。這會讓你的CSS代碼變得冗長,但它現在是唯一的解決方案。

+0

這是W3C規範中的錯誤:「如果逗號分隔列表中的一個或多個媒體查詢爲真,則整個列表爲真,否則爲false。在媒體查詢語法中,逗號表示邏輯或而'和'關鍵字表示邏輯與。「 –