Question

Using IE11's developer tools you can change the browser mode. Everything looks fine in Edge, 10, 9, 8 and 7, however IE5 forces the div to be aligned to the left rather than the middle.

Can someone tell me what am I doing wrong?

Était-ce utile?

La solution

IE 5 predates Microsoft's support for auto margins.

You can hack it by (exploiting a bug in old-IE and) setting text-align: center on the parent element and then text-align: left on the element you want centred.

That said, IE5 is very old, completely unsupported by Microsoft and with a market share as close to zero as makes no difference for almost everyone. I wouldn't try supporting it at all.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top