PhoneGap css媒体查询方面不工作

PhoneGap css媒体查询方面不工作,css,cordova,media-queries,iphone-5,Css,Cordova,Media Queries,Iphone 5,我已经开发了一个以iPhone为设计目标的应用程序(即640x960=>2:3),并且我使用布局中每个分区的百分比来完成,因此ui会根据设备大小进行扩展。现在这在iPad上很好用,但我在9:16的设备上遇到了问题。我已经使用了媒体查询,但这不起作用 分割的默认代码为: .top_bar { height: 9%; } 现在使用媒体查询纵横比: @media screen and (min-device-aspect-ratio: 9/16) { .top_bar {

我已经开发了一个以iPhone为设计目标的应用程序(即640x960=>2:3),并且我使用布局中每个分区的百分比来完成,因此ui会根据设备大小进行扩展。现在这在iPad上很好用,但我在9:16的设备上遇到了问题。我已经使用了媒体查询,但这不起作用

分割的默认代码为:

.top_bar {
    height: 9%;
}
现在使用媒体查询纵横比:

@media screen and (min-device-aspect-ratio: 9/16) {
    .top_bar {
        height: 7.5%;
    }
}
但这在浏览器和设备上都不起作用

我已将视口元标记内容值添加为

content="user-scalable=no, width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, target-densityDpi=device-dpi"
后来我尝试了多种分辨率来检测纵横比,如下所示:

@media 
only screen and (min-device-width: 320px) and (min-device-height: 560px),
only screen and (min-device-width: 480px) and (min-device-height: 850px),
only screen and (min-device-width: 640px) and (min-device-height: 1130px),
only screen and (min-device-width: 720px) and (min-device-height: 1270px),
only screen and (min-device-width: 768px) and (min-device-height: 1360px),
only screen and (min-device-width: 800px) and (min-device-height: 1422px),
only screen and (min-device-width: 960px) and (min-device-height: 1700px),
only screen and (min-device-width: 1080px) and (min-device-height: 1910px)
{

.top_bar {
    height: 7.5%;
}
}
但这也不起作用

更新-已修复

实验稍微改变了最小设备纵横比:9/16最大纵横比:9/16 现在工作正常了

@media screen and (max-aspect-ratio: 9/16) {
    .top_bar {
        height: 7.5%;
    }
}

像这样放置你的元标签

并编写媒体查询

@media only screen and (min-width: 768px) and (max-width: 956px){
.top_bar { height: 7.5%;}
}