css3 媒体查询 大于900怎么写

html-css013

css3 媒体查询 大于900怎么写,第1张

@media (min-width: 900px){

}

需要说明的是,min-width是最小宽度为900,也就是大于900(包括900)

如果是max-width就是最大为900,也就是 小于等于900的情况。

你这么写 max-width: 640px 只是针对普通屏幕,retina 屏幕还要考虑屏幕像素比,retina 的实际像素尺寸只有320,应该这么写:

@media screen and (device-aspect-ratio: 40/71)

或者

@media screen and (device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)