@media query not working in mobile. Works fine in Chrome

后端 未结 3 775
故里飘歌
故里飘歌 2020-11-30 05:42

I am trying to get this working but somehow its not working in mobile. when i use chrome tool to overrides the screen size, it works fine. i am not sure what i am doing wron

相关标签:
3条回答
  • 2020-11-30 06:00

    I know this is an old post, but I recently had an issue like this. I ended up fixing it by removing the CSS media query from the main CSS stylesheet, and entering the specific needs for mobile on the html style section instead. Don't know why it worked, but it did.

    0 讨论(0)
  • 2020-11-30 06:03

    @Andy is right, double check your device-widths, or you could always just use min-width so you don't have to know every device width.

    Regardless make sure you have a viewport tag, like <meta name="viewport" content="width=device-width,initial-scale=1.0">.

    0 讨论(0)
  • 2020-11-30 06:21

    Fantastic - forgot the viewport too! Fot all: Just add

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

    in your head

    0 讨论(0)
提交回复
热议问题