我不是一个强大的编码员,而且我有一个媒体查询语法问题,我真的需要一些帮助。我找到了一个 query specifically for high dpi devices , 如果设备 dpi 足够高,想用它来显示不同的图形。但是,我也希望此查询仅在屏幕低于特定最大宽度时才有效,这就是我在添加时遇到的问题。下面是我一直在尝试的(所以最后一行是我添加的),但它不起作用。非常感谢任何帮助!
@media
only screen and (-webkit-min-device-pixel-ratio: 1.3),
only screen and (-o-min-device-pixel-ratio: 13/10),
only screen and (min-resolution: 120dpi),
and (max-width: 48em)
最佳答案
@media
only screen and (-webkit-min-device-pixel-ratio: 1.3) and (max-width: 48em),
only screen and ( min--moz-device-pixel-ratio: 1.3) and (max-width: 48em),
only screen and ( -o-min-device-pixel-ratio: 13/10) and (max-width: 48em),
only screen and ( min-device-pixel-ratio: 1.3) and (max-width: 48em),
only screen and ( min-resolution: 120dpi) and (max-width: 48em)
{
/* Bla bla Bla bla**/
}
关于html - 媒体查询语法问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38016074/