Closed Bug 147856 Opened 18 years ago Closed 18 years ago

with application/xhtml+xml, body does not cover the whole screen


(Core :: Layout, defect)

Not set





(Reporter: supermario, Assigned: attinasi)




I have two sites with the same content.

Both are XHTML1.1 documents and they have a colored body element. pog1 has
Content-type text/html and the complete background is colored. pog2 is delivered
with application/xhtml+xml and only the part with content is colored.

I think this is a bug in the xhtml renderer. It's possible, that the bug is
connected with Bug#:111514
Not sure if this is bug 111514, but I see the problem with Linux.

Ever confirmed: true
OS: Windows 2000 → All
Hardware: PC → All
<body> never covers the whole screen -- put a border on it to see that.  In 
HTML (_not_ XHTML) it is recommended by CSS2 that the body background be 
propagated to the root element (which is <html>) so that it will cover the 
whole canvas as it does in legacy browsers.

If you want your background to cover the whole canvas, set it on your root 
element, not on some random child.
Closed: 18 years ago
Resolution: --- → INVALID
Please, can you descibe me why the css2 specs recommend that authors specify the
background for the BODY element rather than the HTML element?
For backwards compatibility with user-agents which do not implement that part 
of the specification correctly (NS4, IE5/Windows, IE5.5/Windows, etc).  Also, 
that is for HTML, not XHTML.  If you try serving your XHTML as text/html (so 
it's treated as an HTML document) you will see that the background is 
propagated as expected.

In practice, setting the background on both <html> and <body> is a good idea.
*** Bug 195622 has been marked as a duplicate of this bug. ***
*** Bug 297576 has been marked as a duplicate of this bug. ***
*** Bug 344025 has been marked as a duplicate of this bug. ***
Duplicate of this bug: 379376
You need to log in before you can comment on or make changes to this bug.