Jump to content

Talk:Internet Explorer box model bug

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 213.249.159.244 (talk) at 14:21, 21 June 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

tantek's box model hack is big and clunky, IMO it's much more elegant to just do

padding: 50px;
width: 200px;
width: "300px";

the final rule is only read by IE in quirks mode as it ignores the quotes, providing they correctly wrap the value. you can also narrow the rule to be truly IE-only by prepending an underscore:

_width: "300px";

as only IE (in quirks mode) will treat "width" and "_width" as the same thing.

obviously, though, this does not validate against the w3c standards but is much easier to use in a css file as it is inline, all that is needed is a comment explaining WTF it does, final result:

div.mydiv
{
    padding: 50px;
    width: 200px;
    _width: "300px";    /* hack: IE 5 box model width */
}

i've been plugging away at explorer and have a test page showing various "inline" hacks at my website http://www.cyclomedia.co.uk/?9

213.249.159.244 14:21, 21 June 2006 (UTC)[reply]