Margin: Auto not working in IE

前端 未结 9 1186
悲哀的现实
悲哀的现实 2021-02-19 03:50

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

9条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-19 04:25

    You have RAW php code because you didn't configure the server properly:

    
    
    

    Resolve that issue by applying PHP to *.html files and won't show up literally. If I recall correctly, adjust this line in the .ini file to be:

    AddType application/x-httpd-php .html .htm .php
    

    Because this literal backend code is in front of the DOCTYPE, it causes quirks mode in IE and in quirks horizontal auto margins don't work properly.

    You can go with the text-align:center on parent element, but that's a hack for IE and you should solve this properly by making IE render it in standards mode from my suggestion above.

提交回复
热议问题