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

My Media tags don't work on my website when using my phone

I have just uploaded my website and have been having some problems with @media css tags.
On my website on my desktop the scaling works and when i go into inspect and make the resize the page to make it smaller it resizes. The problem is when i go on the website on my phone. It is like the media tags are ignored and it just displays the desktop version of the website.

Here is an example of my code:
I have my meta tags.

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Here is my @media tags. They are below my normal css styles as i know it can be a problem if they are not .

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

 @media screen and (min-width: 100px) and (max-width: 400px) {...

Here are some pictures of what my website should do when the media tags work.

Website on Desktop

Website on Phone
If you want to go to my website and view it on your phone it is arthropodtec .co.uk

I have tried other tags but they dont seem to work.

@media screen and (max-width: 400px){

>Solution :

Your media query works only when screens are between 100 and 400px. But most of devices are more 400px.(even Iphone XR is at 414px).

Please use this website (https://screensizemap.com/) to check the device dimensions and their popularity and change the media-query accordingly.

But best bet to support all mobiles is use @media (max-width: 515px). Please refer the below image too.

Image showing media groups with highight on mobile media

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