Closed Bug 297576 Opened 20 years ago Closed 20 years ago

XHTML vs. HTML rendering of body background

Categories

(Core :: Layout, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 147856

People

(Reporter: petr.pisar, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

If a page is rendered as HTML, the backgound of body element will fill the whole
viewport regardless the size of body's box. On the other hand if the same page
is rendered as XHTML, the background of body will fill only the body's box.

If you set background of html element explicitly, it behaves in both cases same
as in the XHTML rendering way.

Reproducible: Always

Steps to Reproduce:




<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>XHTML vs HTML body background</title>
<style type="text/css">
    html {
        //background-color: yellow;
    }

    body {
        position: static;

        background-color: red;
        border: dashed 2px;
    }
</style>
</head>
<body>
    <p>
        This body is positioned  static. If document is
        rendered as HTML, the background-color will fill the whole page. If
        document is rendered as XHTML, only thin horizontal stripe will be
        backgrounded. The border is always wide as a viewport and heigh 0px.
    </p>
    <p>
        If you set background of HTML element explicitly. It behaves normal.
    </p>
</body>
</html>
Attached file reporter's testcase
You've described one of the differences between HTML and XHTML.

In the future to help us process your bug reports, please do not cut-and-paste
HTML into the bug report.  Rather, save it as a file and attach it using the
"Create a New Attachment" link.  Two, describe the expected behavior and the
actual behavior as distinct items, so we know what you consider the bug to be. 
Thanks!

*** This bug has been marked as a duplicate of 147856 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
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: