0
如何中心,具有內側「位置」的風格和內容的DIV?我有下面的代碼:如何中心,具有內側「位置」的風格和內容的DIV?
<div class="block" id="block1" style="position:relative;">
<img />
<div id="temperature" style="position:absolute; top:50px; min-width: 400px; height: 300px; margin: 0 auto"></div>
<div id="tempeControl" style="position:absolute; bottom:0; ">
<button id="minus" style="height: 28px; width:128px;">-</button>
<span id="valueTempe" style="font-weight: bold; color: #fea100; width:28px;">0</span>
<button id="plus" style="height: 28px; width:128px;">+</button>
</div>
</div>
我已經試過<center>
,text-align:center
(我認爲這是相同的),並且margin-left:auto; margin-right:auto;
我將避免''