【发布时间】:2016-11-15 01:18:06
【问题描述】:
我的屏幕分辨率是:1280 x 768
我有两个查询,但是最后激活的查询都会被使用,这不是我想要的。被激活的是:1280 x 720。我不明白的是我的屏幕是 1280 x 768?为什么它不起作用?
屏幕 1280 x 768:
@media only screen
and (min-device-height: 768px)
and (max-device-width: 1280px)
and (orientation: landscape)
{
body {
background-color: lightgreen;
}
}
屏幕 1280 x 720:
@media only screen
and (min-device-height: 720px)
and (max-device-width: 1280px)
and (orientation: landscape)
{
body {
background-color: blue;
}
}
【问题讨论】:
-
不确定这是否是个问题,但我不使用“...-device-...”,只使用“min-width”和“max-width”。另外,滚动条可能是个问题。这些是可能会有所帮助的第一个想法
标签: html css media-queries