IE the old "broken" box model is essentially a content-box . In IE> 5, the document must be in quirks mode for IE to use it. You can call quirks mode by doing one of the following ( according to wikipedia ):
- If the document type declaration is missing or incomplete;
- When HTML 3 or earlier is detected
- When an HTML 4.0 Transitional or Frameset document type declaration is used and there is no system identifier (URI)
- When an SGML comment or other unrecognized content appears before a document type declaration
- If there are errors in the document
Now, of course, this probably creates more problems than it costs, because all this will use the IE box model ( content-box ). I could see that this is useful, but if your layout was not built in this way, there is probably too much work to go back and change it.
I searched a bit and did not find anything that would allow using the old window model for certain elements and not others.
Having looked at IE6 / 7 in the past, there is no way around this erroneous behavior without using something like conditional comments or css hacks. The rendering mechanism is simply fundamentally broken compared to other browsers. Trying to get him to behave without any hacks just requires headaches.
The only thing I can think of is to surround each form element with a space or div and use them to help the size of the form elements. It also sucks, but it has the advantage, at least in every browser.
source share