Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Margin: Auto not working in IE

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 .

like image 974
Lewes Avatar asked Oct 18 '11 16:10

Lewes


4 Answers

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>
like image 91
amiry jd Avatar answered Oct 06 '22 02:10

amiry jd


Use this on parent container for stupid browsers:

text-align: center
like image 30
Jan Tojnar Avatar answered Oct 06 '22 00:10

Jan Tojnar


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

Your problem is define your file type and standards. if you add to this code to top of your file it will work!

like image 43
Coşkun GEMİCİ Avatar answered Oct 06 '22 02:10

Coşkun GEMİCİ


try using the following on the parent item.

display: flex;
align-items: center;
like image 21
Daryl H Avatar answered Oct 06 '22 01:10

Daryl H