Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
432 views
in Technique[技术] by (71.8m points)

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

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:

browser

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

enter image description here

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)" /> 
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...