有没有办法为特定的设备宽度和高度设置媒体查询?

时间:2013-10-17 16:49:55

标签: css3 media-queries

@media only screen 
and (min-device-width : 320px) 
and (min-device-height: 480px) 

@media only screen 
and (min-device-width : 480px) 
and (min-device-height: 640px) 

我只想要我们在此设置的任何样式,它应该适用于提及高度和宽度。

1 个答案:

答案 0 :(得分:0)

如果您想定位那些完全分辨率,您只需删除min-前缀,然后指定device-widthdevice-height

@media only screen 
    and (device-width : 320px) 
    and (device-height: 480px) { ... }

@media only screen 
    and (device-width : 480px) 
    and (device-height: 640px) { ... }

W3C reference