在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ 慕課網(wǎng)上底部footer部分,container使用margin:0 auto居

慕課網(wǎng)上底部footer部分,container使用margin:0 auto居中,現(xiàn)有縮小屏幕時的疑問

1.慕課網(wǎng)footer部分,container使用margin:0 auto居中,現(xiàn)在有縮小屏幕時候的疑問
2.相關(guān)代碼如下:

<!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.圖片如下所示

clipboard.pnghttps://segmentfault.com/img/...

5.慕課網(wǎng)的footer的container部分margin卻沒有負值,一直都保持margin-left和margin-right都是24px,這是為什么???

回答
編輯回答
夏木

因為 body: min-width: 1200px;

2017年4月10日 15:50