Home > Net >  media queries in css not working in phone devices
media queries in css not working in phone devices

Time:04-09

I am trying to create a web page and I've added some media queries for managing how the website looks depending on the width of the device. The problem is that, for example, a media query set to affect devices under 800px DOES work if you resize chrome in your computer, but it DOES NOT work in phone devices, even though the condition (less than 800px) is fullfilled. I'm including a link to the website so that you can check this out on your computer/phone

https://serchpics.github.io/Homepage/

I would really appreciate the help because I can't figure out why this might be happening. Thx! :)

CodePudding user response:

Try to add into <head> section: <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

CodePudding user response:

Your site doesn't have a viewport set, so it zooms out every time you load the page.

You can set a viewport by putting this code under your <meta charset="utf-8"> tag.

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

You can learn more about viewports here

  • Related