CSS Media Query Orientation Change Doesn't Work PhoneGap

using

<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"> 

on iPhone Mobile Safari CSS changes when you rotate the device.

No other CSS is loaded on the same page when this code is used as part of the PhoneGap Framework (0.9.5.1). We also had problems with

 <meta name="viewport" 

which can be fixed, but orientation problems remain. Any tips on how to solve this problem are appreciated. Thanks in advance - Alex

+4
source share
1 answer

@alex, perhaps first you check the css file link with firebug, and if the path is correct, 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"> 

may be useful

0
source

All Articles