我想将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