Closed Bug 107417 Opened 23 years ago Closed 23 years ago

display: block should set a default max-width equal to the width of the containing block

Categories

(Core :: Layout, defect)

x86
Windows 98
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: ptrourke, Assigned: attinasi)

References

()

Details

Attachments

(2 files)

When using display: block in CSS on an element (in the test case, an XML element), if max-width is not set and width is not set, the element should be treated as though it had a max-width of 100%, which should be calculated from the width of the containing block (making allowance for margins, padding, etc.). Right now, Mozilla sets no default max-width on elements, so that they run well past the viewport if there is no max-width set. In addition, if max-width is set at 100%, the effect seems to be to set the width at 1em or 100 pixels. I'll attach two files as demos.
> the effect seems to be to set the width at 1em or 100 pixels. Sorry, this should make the report a little clearer: for "1em or 100 pixels" switch "some abitrary width (perhaps 1em or 100 pixels?)" 2001102903 Win98 SE
Note that since the root element (<notices/>) has no "display" property set, it defaults to "inline" per the CSS spec. We therefore have several block elements within an inline element, which is technically not allowed. Adding display:block to the root element gives us the expected behavior.
Got it. Spec does say initial value is inline; Amaya 5.2 provided the behavior I expected, which is permitted, but apparently not the preferred (CSS2 spec): [quote] Note that although the initial value of 'display' is 'inline', rules in the user agent's default style sheet may override this value. See the sample style sheet for HTML 4.0 in the appendix. [/quote] while IE failed to render properly (giving the correct size on the child elements, but flaws in the color rendering) until display on root element was set to block. Marking own bug invalid. Thanks, Mr. Johnston.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: