Internet Explore Help

CaldwellYSR

Member
Because people still build for it. If we stop changing sites so they work in IE then one of two things have to happen. People either a) stop using IE or b) Microsoft will stop trying to make their own rules and come up to standards. I wish I could help you but I don't know IE's rules. Sorry
 

Pheno

New Member
If launching a one man crusade against Microsoft doesn't take your fancy, you could try adding the following lines to the top of your code ;)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 

RoboticPro

New Member
To center a webpage in IE i use
body {text-align:center; //IE Fix}
div#container {text-align:left; margin:0 auto; //Resetting text and centering normal way.}
 

PixelPusher

Super Moderator
Staff member
Doctype a must!!! Well said Pheno.

Other than that, there isn't a special way to center in IE. It's the same as all other browsers. Use the "auto" value for the css property "margin-left" and "margin-right". Define a set width for your site or the body element. Like so:

Code:
/* using a container */
div.container {
 width:960px;
 margin:0 auto;
}

/* Using the body element */
body {
 width:960px;
 margin:0 auto;
}
HTML:
<body> 
  <div class="container"><!-- Your site content --></div>
</body>

That simple. Works in all browsers including IE 6+.
 

Tim

New Member
<!--[if IE 6]>
Link a big image here with links to Safari, Firefox, Chrome and Opera.
<![endif]-->
 
Top