页面代码如下:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>测试</title>
<style>
body{background-color: #09c;}
.w{width: 1200px;margin:20px auto;background-color: #fff;}
.fl{float: left;}.fr{float: right;}
.clearfix::after{display:table;content:" ";clear:both;}
.test-box{background-color: #fff;}
</style>
</head>
<body>
<div class="w clearfix">
<div class="fl">1111</div>
<div class="fr">222</div>
</div>
<div class="test-box">1111</div>
</body>
</html>
手机端打开看会发现html和body的宽度缩小了,设置100%也不行。
请问这是哪里造成的问题?
找到解决方案了,body要设置min-width:1200px;
真特么的反直觉。