CSS媒体查询方向更改不工作PhoneGap [英] CSS Media Query Orientation Change not working PhoneGap

查看:150
本文介绍了CSS媒体查询方向更改不工作PhoneGap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用

<link rel="stylesheet" media="all and (max-width: 640px) and (orientation:portrait)" href="css/i-hoch.css"> 
<link rel="stylesheet" media="all and (max-width: 960px) and (orientation:landscape)" href="css/i-quer.css">  

在iPhone Mobile Safari上旋转设备时,CSS会更改。

on iPhone Mobile Safari the CSS is changed when device is rotated.

当此代码在PhoneGap框架(0.9.5.1)中使用时,同一页面不会加载不同的CSS。我们还遇到了

The same Page does not load the different CSS when this code is used within the PhoneGap Framework (0.9.5.1). We also had issues with the

<meta name="viewport" 

这可以是固定的但是定向问题仍然存在。
任何提示如何解决这个问题。提前感谢 - Alex

which could be fixed but orientation problems remain. Any hints how to solve this issue are appreciated. Thanks in advance - Alex

推荐答案

@alex,可能是首先你检查你的css文件链接firebug&如果路径正确,

这样写

@alex, may be first you have check you css file link with firebug & if the path is correct then
write like this

<meta name="viewport" content="width=device-width">

<link rel="stylesheet" media="all and (orientation:portrait)" href="css/i-hoch.css">  
<link rel="stylesheet" media="all and (orientation:landscape)" href="css/i-quer.css">

可能会有帮助

这篇关于CSS媒体查询方向更改不工作PhoneGap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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