媒体查询:屏幕> 1024

m4g*_*4bu 9 css media-queries

我正在尝试在网站中应用媒体查询,但我的知识并不深入本主题,所以基本上我想在检测到的屏幕大于1024*768时将特定样式应用于标记.

我这样做了

@media screen and ( device-width: 1024px ) {

}
Run Code Online (Sandbox Code Playgroud)

但我要确定何时分辨率大于1024

Mik*_*ant 30

试试这个:

@media only screen and (min-width : 1025px) {
    .classname {
        /* styles here */
    }
}


@media only screen and (max-width : 1024px) {
    .classname {
        /* other styles here */
    }
}
Run Code Online (Sandbox Code Playgroud)


Sti*_*ers 6

使用标准的媒体屏幕查询。一旦宽度为1024px或更大,查询将触发样式更改。

@media screen and (min-width: 1024px) {
    /* Styles go here */
    #layout {
        width: 90%;
    }
}
Run Code Online (Sandbox Code Playgroud)


Tie*_*ies 2

@media all and (min-width: 1024px) {
  #css {
    foo : bar;
  }
}
Run Code Online (Sandbox Code Playgroud)