1.慕课网footer部分,container使用margin:0 auto居中,现在有缩小屏幕时候的疑问
2.相关代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{
margin: 0px;
padding: 0px;
}
body{
overflow:visible;
}
.demo-wrapped{
width: 1202px;
height: 400px;
margin: 0 auto;
text-align: center;
}
.demo-header{
background: blue;
}
.box{
text-align: right;
background: orange;
}
.box img{
width: 300px;
height: 300px;
}
</style>
</head>
<body>
<div class="demo-header">
<div class="demo-wrapped">
<div class="box">
<img src="images/300.png" alt="">
<img src="images/300.png" alt="">
<img src="images/300.png" alt="">
</div>
</div>
</div>
</body>
</html>
3.疑问:
width:定值;margin:0 auto;当屏幕变小,body的宽度也随之变小,此时margin将变负值
4.图片如下所示
https://segmentfault.com/img/...
5.慕课网的footer的container部分margin却没有负值,一直都保持margin-left和margin-right都是24px,这是为什么啊?
因为
body: min-width: 1200px;