我想將div放在中間(水平)。 與此同時,我想把div margin-top:40px和margin-bottom:20px。 但是,一旦我分配了保證金:0自動,保證金頂部和底部不起作用。無法在中心放置div(margin:0 auto;不起作用)
#circle_price {
background-color: red;
width: 100px;
height: 100px;
background: red;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
margin-top: 40px;
margin-bottom: 20px;
margin: 0 auto;
}
任何人有這個想法?謝謝。
你能發佈你使用的實際代碼嗎?該命令可能是相關的,也可能會影響它的任何其他元素 – Lynch
我已經得到了這個。非常感謝Lynch! – KingkongP
不用擔心,是我想到的問題! – Lynch