HTML 禁止在移动端缩放
HTML 大约 1011 字需求
禁止网页在Android
、iOS
、平板等设备中缩放,导致元素大小不一致。
方法
添加viewport
,设置缩放属性。
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
示例
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title</title>
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
</head>
<body>
<div>
this is very long text this is very long text this is very long text this is very long text this is very long
text
</div>
<div>
this is very long text this is very long text this is very long text this is very long text this is very long
text
</div>
<div>
this is very long text this is very long text this is very long text this is very long text this is very long
text
</div>
</body>
</html>
阅读 688 · 发布于 2021-06-23
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
前端文件下载时重命名文件名阅读 3407
-
前缀表达式、中缀表达式、后缀表达式阅读 1311
-
Spring Boot Gradle 项目添加本地 jar 包依赖阅读 2656
-
Elasticsearch 监控运行状态阅读 1448
-
Spring Boot 使用 @ControllerAdvice 注解处理全局异常阅读 1540
-
数据结构:平衡二叉树阅读 407
-
MongoDB 备份、还原与导出、导入阅读 3767
-
Java JDBC 获取数据库链接阅读 129
-
OpenResty 整合 LuaRocks - Linux阅读 1309
-
dubbo-admin Failed to invoke remote method: getMetricsByGroup阅读 4560