關(guān)于 margin
width:200px;
margin:20px 20px auto; 這里為什么不可以實(shí)現(xiàn)居中了 設(shè)置了上下左右的邊距為什么不可以實(shí)現(xiàn)居中 ? margin:20px auto; 這樣又可以居中?
width:200px;
margin:20px 20px auto; 這里為什么不可以實(shí)現(xiàn)居中了 設(shè)置了上下左右的邊距為什么不可以實(shí)現(xiàn)居中 ? margin:20px auto; 這樣又可以居中?
2016-07-26
舉報(bào)
2016-07-26
margin設(shè)置的順序是上右下左,你還要明白它的簡(jiǎn)寫樣式。
2016-07-26
margin:20px 20px auto;依次設(shè)置上 右 ?為20px 下 右的邊距自動(dòng)生成?
margin: 20px auto 為上下20px 左右自動(dòng)生成相等的邊距 所以居中了