媒体查询优先级

Mar*_*ark 5 css media-queries

我有以下媒体查询:

@media all and (max-height: 720px) and (min-width:1px) {
    .tabeditor {
        height: 60%;
    }
}

@media all and (max-height: 768px) and (min-width:1px) {
    .tabeditor {
        height: 63%;
    }
}
Run Code Online (Sandbox Code Playgroud)

当我在 1280X720 上运行它时,我看到 768px 查询的高度接管了。那是对的吗?我在 Chrome 中运行它。

感谢帮助。

Jaa*_*aay 2

@media all and (max-height: 720px) and (min-width:1px) 
{
    .tabeditor {
        height: 60%;
    }
}
@media all and (max-height: 768px) and (min-height : 721px) and (min-width:1px) 
{
    .tabeditor {
        height: 63%;
    }
}
Run Code Online (Sandbox Code Playgroud)

您可能还需要一个 @media all and (min-height: 769px) and (min-width:1px)