Margin: Auto not working in IE

Lewes picture Lewes · Oct 18, 2011 · Viewed 51.9k times · Source

URL: http://cyberbat.co.uk/test container margin: auto is not working, is there any other way to put it in the middle in IE.

EDIT: Check it again, the index.php was the wrong file, I replaced it with index.html .

Answer

ravy amiry picture ravy amiry · Oct 18, 2011

This is a bug in IE! You just need to create a holder for <div class="page"> and set its text-align to center

.page-holder{
    text-align:center;
}
.page{
    margin:0 auto;
}
<div class="page-holder">
    <div class="page">
    page content
    </div>
</div>