Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

@media (max-width: 640px) not working for mobile

This codepen link: https://codepen.io/gianlucaas/pen/bGrmQVO hosts my code for one of my pages for a new website.

the problem is, when I go and test it on mobile (you can try it too, on the codepen link), it looks perfect. you can see the rolex goes to the top right corner (the image) and it looks proper. BUT, when i go to my live link, which is (won’t show now for privacy purposes). please see answer that solved issue below…

(ON MY IPHONE), it looks like the desktop application, but it is supposed to look like the phone version! I cannot figure out why for the life of me. Does anyone have any suggestions as to what I could be doing wrong?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You need viewport definition in page header, codepen adds that.

<meta name="viewport" content="initial-scale=1.0, width=device-width" />
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading