
Originally Posted by
Wedgy
I still don't see how allowing overspill isn't a glaring error, if you are going to insist that the background be confined to a predefined area.
Because it's quite clear from reading the specification? Besides, if one stops to think about the alternatives for a moment, it's clear the current behaviour is the most logical.
Starting with the height property, its use is to say to the browser, "I want the content box of this element to be rendered exactly x units high." If that isn't the desired behaviour, then it isn't the property that should be used.
With regard to the overflow property, the default value of visible provides the most accessible behaviour, as well as behaviour that is absolutely necessary for some quite common effects.
If hidden is used, content will be clipped making it unreadable. If auto is used, overflowing content will cause scrollbars to be shown, potentially producing a scrolling area inside another scrolling area: a usability problem. The scroll value will always invoke the latter, overflowing content or not.
An example of an overflow effect is some uses of absolute positioning (there are others). If the left property value is greater than 100% (either as a value in itself, or a length value as a proportion of the width), or if the right property is a negative length, the positioned element will be rendered out of the boundaries of its containing block. This isn't possible without overflow: visible.
Finally, the background property simply can't be confused. From the CSS 2 Recommendation, section 14.2 - The background:
Authors may specify the background of an element (i.e., its rendering surface) as either a color or an image. In terms of the box model, "background" refers to the background of the content and the padding areas. Border colors and styles are set with the border properties. Margins are always transparent so the background of the parent box always shines through.
If the content overflows the padding, it should be obvious what the result will be.
In most situations, the overspill will be a miscalculation by the page-designer, or a result of resetting the font-size by the viewer in his browser.
Boxes that contain text should either never be assigned sizes in pixels (use a font-proportional unit), or they should be allowed to grow. There are no excuses if the developer cocks this up.
It appears ludicrous to me to insist that Firefox is not committing some kind of buggy behaviour in this (the most common) case.
It is ludicrous to me that some Web developers don't read specifications, but then expect to be able to predict the right outcomes.
Again, how does having a background only on part of the contents help in any way?
As I said, if that isn't the intended behaviour, don't use properties in such a way that produces that effect.
Mike
Bookmarks