When putting someones old javascript function on my page it makes it no longer center in IE(7). What I think is causing it is the page width is getting superficially longer as a result of the script.
This is how I have it centered:
#container{width:960px; margin:0 auto;}
Here is what I have tried to fix it (needless to say it didnt work):
if (navigator.appName.indexOf("Microsoft")!=-1) {
document.getElementByID("container").style.marginLeft=(((document.body.offsetWidth - 960)/2));
}
Thank you ahead of time! 🙂
Internet explorer has had problems with margin:0 auto since the dawn of its creation. Its very picky.
Take a look at number 6 on this article and try that
http://www.webcredible.co.uk/user-friendly-resources/css/internet-explorer.shtml