2017-08-23 28 views
0

该代码在桌面计算机(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>

+0

可能的重复[如何使移动放大,因为它是在PC ....?](https://stackoverflow.com/questions/45871416/how-can-i-make-zoom-in- mobile-be-as-its-on-pc) – BSMP

回答

1

<head>试试这个:

<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' /> 
+0

好的,我会试试看。 – Tomas

相关问题