我正在做一个响应式网站,但我遇到了这个问题:一切正常,直到我选择一个[input type="text"]并打开键盘后,整个网站都会被调整大小,就好像屏幕大小只有键盘上面的部分。我希望保持正常尺寸。我已经尝试了stackoverflow和其他论坛提出的所有解决方案,但似乎没有任何作用。
有人有什么解决办法吗?
<head>
<title>SchoolIn</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
//other code
更新: 我将尝试更好地解释。
我有一个头部区域。
//other code
<div class="head">
//Here is some text
</div>
//other code
接下来是内容部分
//other code
<div class="container">
<div class="content">
//other code
<input type="text" ...... />
<input type="password" ..... />
<input type="submit" ..... />
</div>
</div>
//other code
所有元素都是以百分比而非像素为单位。
当键盘弹出时,标题、容器和内容div会被重新定义大小,而输入字段和按钮则不会。无论如何,它们都会从其容器中弹出,因为容器变小了而它们保持原始大小。我不知道我是否表达清楚。
问题相同,如何使它在键盘弹出时保持原始大小?