Hi, I’ve got a page with a div that I wish to center on the page.
Additionally it should be offset from the top of the document edge by a certain pixel amount [COLOR=Blue]margin-top
[CODE]
html, body {background: #000000;
margin: 0; padding: 0;
[COLOR=Red]text-align: center;[/COLOR]} /*IE block element centering*/
div.center {background: url(Backgrounds/centerImg.gif)
center center no-repeat;
[COLOR=Red]margin: 0 auto;[/COLOR]
[COLOR=Blue]margin-top: 115px;[/COLOR]
width: 460px;
height: 470px;
padding: 10px;}
The code works as intended In Firefox 1 and Safari for Mac OS. But on IE6 for PC the “center” div is left-aligned instead of centered, and the top margin is not the same, and the page looks very different in that browser.
I thought that ‘text-align: center” would center elements in IE? And why, WHy, is the margin different in IE? ?
help’s appreciated.