vinpkl Posted May 7, 2015 Share Posted May 7, 2015 (edited) Hi can anyone tell me why this code is not working in chrome emulator You can select devices like "Google nexus 4, Google nexus 5" or similar which has width less than 480 Border and padding is not getting applied. Floating is also not working ?? <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <style type="text/css" media="screen"> @media screen and (max-width:480px){ .firstcol{width:90%; border:1px solid #ff0000; padding:10px; font-size:2em} .secondcol{width:90%; border:1px solid #ff0000; padding:10px; font-size:2em} } @media screen and (min-width:600px) and (max-width:800px){ .firstcol{width:42%; float:left; border:1px solid #ff0000; padding:10px; font-size:2em} .secondcol{width:42%; float:left; border:1px solid #ff0000; padding:10px; font-size:2em} } </style> </head> <body> <div class="firstcol">This is the first column</div> <div class="secondcol">This is second column</div> </body> </html> Thanks Vineet Edited May 7, 2015 by vinpkl Quote Link to comment Share on other sites More sharing options...
fastsol Posted May 7, 2015 Share Posted May 7, 2015 Wow that is weird. I tried to make it work too and I can't figure out why it won't. It works in normal chrome and firefox. I found this post about the possible issue iwth the chrome emulator http://stackoverflow.com/questions/26888751/chrome-device-mode-emulation-media-queries-not-working So I don't think it's your code, but rather the browser. Quote Link to comment Share on other sites More sharing options...
NetGuru87 Posted May 9, 2015 Share Posted May 9, 2015 I am also pretty sure that its not your code and rather the emulator. If you paste it into a link and put the link in the post I have a buddy with a Nexus 4, who can go check it out on his device to se if it actually reders like the emulator. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.