Home > Web Front-end > HTML Tutorial > 怎么让手机浏览器和微信焦点在文本输入框时不自动放大页面_html/css_WEB-ITnose

怎么让手机浏览器和微信焦点在文本输入框时不自动放大页面_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:20:49
Original
2268 people have browsed it

方法一:禁止页面缩放

在head标签中加入以下代码

<meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0, user-scalable=no">
Copy after login

content的解释

width=device-width //宽度等于设备屏幕宽度initial-scale=1.0  //初始缩放比例minimum-scale=1.0  //最小缩放比例maximum-scale=1.0  //最大缩放比例user-scalable=no   //用户是否能进行缩放
Copy after login

二、通过设置input的字体来阻止

@media only screen and (min-device-width : 320px) and (max-device-width : 1024px) { select:focus, textarea:focus, input:focus { font-size: 16px !important; } }
Copy after login

浏览器也许认为,只有input中的字体大于等于16px时用户才能看得清楚。

资料引用

怎么让Android 浏览器焦点在文本输入框时不自动放大页面

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template