How can center a div which has "position" styles and content inside? I have the next code:
<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>
I've tried with <center>
, text-align:center
(I think that are the same), and margin-left:auto; margin-right:auto;