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

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

WBOY
WBOYOriginal
2016-06-24 11:20:492270browse

方法一:禁止页面缩放

在head标签中加入以下代码

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

content的解释

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

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

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

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

资料引用

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

Statement:
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