I am using Cordova to make a hybrid app.
I have the following media queries in my css file
@media only screen and (min-device-width : 320px) and (orientation: portrait) {
/*css goes here*/
}
@media only screen and (min-device-width : 320px) and (orientation: landscape) {
/*css goes here*/
}
and similarly media queries for all sorts of device width in both portrait and landscape orientation.
When I test my app on Nexus 4, it doesn't detect the orientation change and change the css, example, if I start the app in portrait mode, then based on the device width it picks up the media query of that width in the portrait mode, however if then I change the orientation of the phone, it doesn't detect the new width and apply the new css of the corresponding width and landscape orientation and vice versa.
Am I missing something here, isn't CSS Media query supposed to detect the change in orientation by itself and apply the appropriate CSS?
min-widthinstead ofmin-device-widthto check if this also does not work. - rockStar