html - 网站似乎在 chrome 上缩小了
问题描述
我已经在一个网站上玩了一段时间了,似乎当我在 chrome 上打开它时,在移动设备上,它完全崩溃了。
为了解决这个问题,我制作了导航栏的最小副本,但问题仍然存在。
我有下面的代码,如果有人可以帮助我,那就太好了:)。
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Heading -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1,width=device-width,initial-scale=1.0">
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse">
<!-- Navbar toggle button -->
<button class="navbar-toggler navbar-toggler-right" type="button"
data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Navbar logo -->
<a class="navbar-brand" href="/#">
<img class="img img-responsive" style="width:48px; height:48px;" alt="logo"
src="http://icons.iconarchive.com/icons/graphicloads/100-flat/256/home-icon.png" />
</a>
<!-- Some other navbar shit; mostly -->
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto animated ">
<li class="nav-item" id="home-navi">
<a class="nav-link" href="/#"><i class="fa fa-home" aria-hidden="true"></i> Home </a>
</li>
<li class="nav-item" id="help-navi" >
<a class="nav-link" id="help" href="/#"><i class="fa fa-question-circle" aria-hidden="true" ></i> Help </a>
</li>
</ul>
</div>
</nav>
</body>
</html>
这里是出了什么问题的照片。(两者都在开发工具三星 Galaxy S5 上进行了测试)。
-谢谢,山姆。
解决方案
修复!
事实证明,这是元标记的问题。
将此添加为元标记
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
似乎在chrome上修复它。
- 希望这会有所帮助,山姆。
推荐阅读
- reactjs - 使用反应路由器时,如何在 iframe 中使用反应应用程序提供静态 html 文件?
- python - 运行python模块时如何附加到vscode调试器?
- java - java.lang.NoClassDefFoundError:无法初始化类 sun.security.provider.SecureRandom$SeederHolder
- java - 错误:访问被拒绝在 Android Studio 中找到属性“ro.serialno”
- javascript - v-bind:href 中的 vue.js 2.x HTML 实体
- openapi - 如何在 openAPI 中设置安全标头,以便使用 swagger 编辑器将其包含在所有请求中
- elasticsearch - 弹性搜索中的模糊性按字母而不是按单词搜索
- mysql - docker compose 中的 Airflow + MySQL - 未知主机和访问被拒绝
- docker - 无法使用 puppeter 和 docker 映像启动浏览器进程
- azure-data-factory-2 - Azure 数据工厂中的自定义活动