媒体查询:屏幕> 1024 [英] Media Queries: Screen > 1024

查看:462
本文介绍了媒体查询:屏幕> 1024的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在网站中应用媒体查询,但我的已知问题在此主题中并不深入,因此,当检测到的屏幕大于1024 * 768时,我基本上要对标记应用特定样式。



我这样做了

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

}

分辨率大于1024


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


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


I'm trying to apply media queries in a site but my knownledge is not deep in this topic, so basically I want to apply a specific style to a tag when the detected screen is greater than 1024*768.

I did this

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

}

but the I've to identify when the resolution is greater than 1024

解决方案

Try this:

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


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

这篇关于媒体查询:屏幕> 1024的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆