css3 - Google Pixel C device UI not changing to landcape mode based on CSS selector -


i working hybrid application, , found "google pixel c" device, ui shown in portrait mode same landscape mode though css selector used change. using cordova framework development. when device in landscape mode applying landscape class body tag , removing class, when device in portrait mode.

the media query used show landscape mode shown below:

@media screen , (min-width:480px) {     body.landscape #login #logo {         float: left;         width: 45%;         margin: 4% auto;    }     body:not(.landscape) #login #logo {         width: 100%;         margin: 4% auto;    } 

}

i tried using media query:

@media screen , (min-width:480px) , (orientation : portrait) {   #login #logo {     width: 100%;     margin: 4% auto;   } }  @media screen , (min-width:480px) , (orientation : landscape) {   #login #logo {     float: left;     width: 45%;     margin: 4% auto;    } } 

but found when keyboard up, media query of landscape gets applied though device in portrait mode.

is else facing same problem?? suggestion help.

found solution problem. when there orientation change, have started applying landscape class body tag , written media queries accordingly


Comments