我有一个移动网站,但它缩小了载入。我怎样才能解决这个问题? [英] I have a mobile website but it loads zoomed out. How can I fix this?

查看:94
本文介绍了我有一个移动网站,但它缩小了载入。我怎样才能解决这个问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个手机网站,但它会缩小。我该如何解决这个问题。

I have a mobile website but it loads zoomed out. How can I fix this.

推荐答案

您应该插入Viewport元标记。 b

You should insert the Viewport meta tag.

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




这意味着浏览器将(可能)呈现
页面在其自己的屏幕宽度。因此,如果该屏幕宽度为320px,则
的浏览器窗口宽度为320px,而不是缩小,
显示的是960px(或者默认情况下该设备所做的任何操作,以代替
响应meta标签)。

This means that the browser will (probably) render the width of the page at the width of its own screen. So if that screen is 320px wide, the browser window will be 320px wide, rather than way zoomed out and showing 960px (or whatever that device does by default, in lieu of a responsive meta tag).

参考: Css-Tricks - 响应元标记 - MDN - 使用视口meta标签控制移动浏览器的布局

这篇关于我有一个移动网站,但它缩小了载入。我怎样才能解决这个问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆