代码在桌面计算机(PC)上运行良好,当我放大和缩小文本时,文本仍然存在,但在移动设备上,当我尝试放大此页面时,文本超出了屏幕视图的左边框和右边框。
我该怎样防止这种情况?我希望唯一的滚动是上下,而不是左右。是的,并且用户将看到所有页面内容而不会溢出到双方。
您可以在此处测试我的代码:
http://fireman-suppression-84203.bitballoon.com
以下是代码:
div {
width: 85%;
margin: auto;
border: 3px solid #73AD21;
}

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<div>Just an example text... Just an example text... Just an example text... Just an example text... Just an example text... Just an example text... Just an example text... Just an example text... Just an example text... Just an example text... Just an example
text... Just an example text... Just an example text... Just an example text... Just an example text... Just an example text... Just an example text... Just an example text... Just an example text... Just an example text... Just an example text... Just
an example text... Just an example text... Just an example text... </div>
<br>
&#13;
答案 0 :(得分:1)
在<head>
:
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />