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?

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top