响应式网页设计适用于桌面,但不适用于移动设备 [英] Responsive web design is working on desktop but not on mobile device
本文介绍了响应式网页设计适用于桌面,但不适用于移动设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个网站,必须对手机做出响应.我是用我的桌面创建的.当我调整浏览器窗口时,它在手机上运行良好,但当我在我的真实手机上检查它时:三星 Galaxy S2,它对移动视图没有响应.
I have a website which must be responsive for mobile phones. I've created it using my desktop. When I adjust browser windows it's working perfectly for mobile phone but when I check it on my real mobile phone: Samsung Galaxy S2 it's not responsive to the mobile view.
可能有什么问题?
推荐答案
您可能缺少 html 头中的视口元标记:
You are probably missing the viewport meta tag in the html head:
<meta name="viewport" content="width=device-width, initial-scale=1">
没有它,设备会假设视口并将其设置为全尺寸.
Without it the device assumes and sets the viewport to full size.
更多信息此处.
这篇关于响应式网页设计适用于桌面,但不适用于移动设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文