My HTML code contains a div with the property “text-align: center“, but it doesn’t center in firefox, although it does in IE. If I change the display property to inline it centers nicely, but the height and width constraints are lost. This thing seems not to work properly with firefox.
The fact that IE renders text-align: center as a way to center block type elements is not the right way in the flow. text-align: center is for centering inline type elements in a block type element.
The right way of doing it is giving the DIV elements margin: 0 auto;
Alternatively we can use text-align: -moz-center; but this works only for Firefox.
Be First To Comment
Related Post
Leave Your Comments Below