一個html中只有一個div。<div class="test"></div>css1:.test{ width:200px; height:200px; border:1px solid red; margin:0 auto; }css1可以使div.test左右居中。css2:.test{ width:200px; height:200px; border:1px solid red; margin:auto auto; } 為何css2不可以使div.test上下左右居中?? 請不要回答如何使他div.test上下左右居中,請回答為何margin:auto auto;不能上下左右居中??
為何margin:auto auto 不能上下左右對齊?
揚帆大魚
2018-11-14 13:13:01