As we talked about in the comments, there are major differences between IE version releases. IE6 through 8 are considered legacy browsers, while IE9 and greater are more inline with standard newer web technologies (css3 support only entered with IE10 for example).
When you said that it looked the same using different version I immediatly suspected it had something to do with quirks mode. quirks mode is a technique which allows support for older browsers. And it is the default mode for IE if you are not using <!DOCTYPE html>
. By adding that to the top of your page you are saying to IE 'use standards mode' (and check out that link I mentioned for details about different types of DOCTYPE's and what they mean).
It also greatly explains why you were seeing such a specific problem with the css attribute of the width: 100%
, to quote the wiki article (emphasis mine):
One prominent difference between quirks and standards modes is the
handling of the CSS Internet Explorer box model bug. Before version 6,
Internet Explorer used an algorithm for determining the width of an
element's box which conflicted with the algorithm detailed in the CSS
specification, and due to Internet Explorer's popularity many pages
were created which relied upon this non-standard algorithm. As of
version 6, Internet Explorer uses the CSS specification's algorithm
when rendering in standards mode and uses the previous, non-standard
algorithm when rendering in quirks mode.
Today, with a less than 5 percent usage of legacy browsers (which also support the newer width algorithm because it was introduced with the now extremely old IE6), you probably wouldn't need to use quirks mode ever, but it helps to know why adding the doctype is important (rather than doing it blindly).