Closed Bug 90356 Opened 25 years ago Closed 25 years ago

XHTML - styles applied to body element do not apply to entire content area

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows 2000
defect
Not set
minor

Tracking

()

VERIFIED INVALID

People

(Reporter: kelson, Assigned: pierre)

Details

Attachments

(1 file)

If you assign a background color to an XHTML document, whether using embedded CSS, linked CSS, or the transitional DTD and the <body bgcolor="..."> syntax, it only applies to a box around the content, not the entire window area. The rest of the window area is the default background color. You can fake around things a bit on the left, right, and top by setting a margin of 0 and a non-zero padding, but the empty space below the content still shows the default window background color.
Actually, <body/> is a block element like any other, so a background-color applied to it will not cover its margins (at least in strict mode.) The "expected" behavior is a quirk to support the incorrect behavior of older browsers when in quirks mode. Moz applies a default margin to the <body/>. If you remove the margin via css, the background-color will go to the left, top, and right of the viewport. Then if you set height:100% it will extend to the bottom. I believe this is strictly correct behavior and not a valid bug.
Actually <body bgcolor=""> should work. background-color CSS will probably have to be applied on the html element.
For XHTML served as text/html we apply the fixup rule that CSS recommends and propagate background-color from <body> to <html> For XHTML server as text/xml or application/xhtml+xml we apply XML rules and actually do what the document asks us to do. This means no body fixup rule. The testcase in question is application/xhtml+xml. Marking invalid -- this is correct behavior. Use a stylesheet to apply a background-color to <html> if you want it to cover the whole viewport.
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
v
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: