Responsive width is too small on phone, but okay on desktop browser

本小妞迷上赌 提交于 2019-12-29 01:27:15

问题


I am practicing responsive web design. From what I've learned so far, it revolves around a fluid grid with fluid components, and CSS media queries.

The website looks just like how I want it to look like on a mobile phone when I shrink my browser:

However, when on my mobile phone, after being put on my web server, it looks completely different:

I think there is some conflict between width and device-width that is occurring. Does anyone know what is going wrong?

This is how i load my stylesheets:

<link href="/stylesheets/index.css" rel="stylesheet" type="text/css" /> 
<link href="/stylesheets/mobile.css" rel="stylesheet" type="text/css" media="screen and (max-width: 600px), screen and (max-device-width: 600px)" /> 

回答1:


There is not responsive without viewport meta tag

<meta name="viewport" content="width=device-width, user-scalable=no">

More about viewport meta tag https://developer.mozilla.org/en/docs/Mozilla/Mobile/Viewport_meta_tag



来源:https://stackoverflow.com/questions/24195904/responsive-width-is-too-small-on-phone-but-okay-on-desktop-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!