给了外层盒子100%宽度,结果移动端依然有横向滚动条。
解决
在head中添加:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="viewport-fit=cover,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,target-densitydpi = medium-dpi"/>
<meta name="format-detection" content="telephone=no" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
即可解决。