CSS——媒体查询

213 阅读1分钟

媒体查询

屏幕小于1366px
@media screen and (max-width: 1366px){
    #date-range{
    width: 70%
    }
}

屏幕大于1366px 
@media screen and (min-width: 1366px){
    #date-range{
    width: 56%
    }
}

根据窗口高度

@media screen and (max-height: 768px) {
    /*高度小于768px*/
}

@media screen and (min-height: 767px)and (max-height: 1080px) {
   /*高度在768~1080px之间*/
}

@media screen and (min-height: 1080px) {
   /*高度大于768~1080px*/
}