The 'width' and 'height' properties do not apply to inline non-replaced elements. See CSS2 10.3.1 and 10.6.1. (WinIE does this wrong, displaying elements with 'display: inline' more like they had 'display: inline-block' once they're given a 'width' and 'height'. Neither Mozilla nor WinIE actually supports 'inline-block' yet, although MacIE does.) That said, your testcase would probably work a little better in Mozilla if you were in standards mode since the inline elements would have different sizes. See http://mozilla.org/docs/web-developer/quirks/ I can also only guess how it looks in WinIE since there is no WinIE for Linux.
Even if you leave out the width and height attributes for the a tag, it doesn't matter in IE6. CSS clearly writest that if a tag is declared to not be visible, it's not displayed, but unlike display:none, the dimension of the element still affect the page layout. That means even so I hide the image, the image has a dimension specified in CSS, which is certainly allowed and thus the a element should have the dimension of the IMG tag, regardeless whether it's displayed or not, shouldn't it? Mozilla correctly creates an empty box with the dimension of the image, but it's not possible to give this box a background... why not? Giving IMG a background doesn't work, as if the image is not visible, its "box" isn't visible either, and without box, there is no background of the box. Well, I will for sure file another bug, as when I made the test with DIV tags (that can for sure have a dimensions), I couldn't give them a background either.
No, inline elements do not expand vertically to contain their children. That's another bug in WinIE. See CSS2 10.6.1 (the height is given by the 'line-height' property). That said, in quirks mode, the height we're using may be incorrect (zero rather than the height of the 'line-height') -- see my previous comment. Perhaps you could link to or attach your DIV testcase here, since all the other issues in this bug are not valid?
I don't have the DIV test case anymore, because it's useless for a practical purpose, since it's a block tag and A is not (a big mistake IMHO); also IE doesn't handle it well either, so I deleted it again. But I will file another bug if I can re-build this test case again. Marking this one invalid.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.