If you added a full (and correct) DTD at the very top of your markup document, MSIE6 will behave as it should regarding how it adds widths, borders, margins, etc…
A full and complete DTD will trigger MSIE6/Win's 'standards-compliant' mode which means it will interpret the '
box model' correctly.
Looking briefly at your source markup, the DTD that falls closest to the standard of markup is HTML 4.01 Transitional
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
It's my understanding that (for reasons best known to the ham-fisted apes in MS's IE/Win department) MSIE6
can act up when using a full HTML 4.01 Transitional DTD. Using a partial DTD keeps MSIE/Win in non-standards'compliant mode ('quirks mode') which means that it will continue to misinterpret the box model.
With a little more effort (see validator mentioned below), you could get the markup up to HTML 4.01 Strict standards, which, when used with a full HTML 4.01 Strict DTD will keep MSIE6/Win on its best behaviour.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
Unfortunately, MSIE5/Win cannot be convinced to understand the box model correctly and requires the use of a workaround or a '
box model hack'.
The box model hack is possibly the easiest to implement as it doesn't require you to restructure your site.
-
You also need to add a character encoding meta tag. You can safely use either of these:
Code:
<meta http-equiv="content-type" content="text/html; charset=utf-8">
Code:
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
Once you have added both the DTD and the character encoding tag, the first few lines of your markup document will appear something like this:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>…
Once you have that sorted, you should then test your markup with the
W3C online markup validator. This will highlight errors and issues in the markup that may lead to problems in how the page appears in some browsers.
Go through the list and resolve each issues.
Once you have valid markup, your site pages should appear with an improved level of consistency across a range of browsers.