2

im trying to put retina background images in certain elements and im having trouble actually getting these media queries to work. Sublime text wont syntax highlight them either so im pretty sure this stack is broken but i have no idea what to do. Help 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){ 
}
4

1 回答 1

0

应该只应用一个像素配给它才能工作。想想看,当 -webkit-min-device-pixel-ratio 为 1.5 时,不会是 -o-min-device-pixel-ratio。我们只有“和”规则。如果所有规则都不是一次为真,则不会应用该条件。

试试这个代码:

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

对于其他规则,每次都单独应用它们。这将导致您的 CSS 代码很长,但它是目前唯一的解决方案。

于 2012-10-27T09:37:25.787 回答