android - Nexus 7 takes styling of landscape mode when the device is oriented from landscape to portrait after some idle time -


i facing strange issue nexus 7 regarding css media queries. media query runs fine on orientation change, if keep device in landscape mode , keep idle time , on orientation change viewport takes styling of landscape mode other portrait mode styling.

here code have written

<!doctype html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="css/css.css" rel="stylesheet" type="text/css" /> </head> <body> <div></div> </body> </html> 

and in css file styling below.

div {height: 500px; width: 500px;}  @media screen , (min-width:480px) { div {background: red;} } @media screen , (min-width:768px) { div {background: green;} } 

for other devices ipad, iphone, s3 etc media queries runs fine if these devices kept idle , on orientation takes respective viewport styling, on nexus 7 div colour remains green when orientation changes landscape portrait view after device kept idle time.

please me out situation.

try updating viewport meta tag attributes <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -