Closed Bug 296384 Opened 20 years ago Closed 19 years ago

mozilla renders div boxes incorrectly

Categories

(Core :: Layout, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: mnemo, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040803
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040803

Mozilla renders the SPANs outside of the DIV just because I add padding on the
SPANs ?! MSIE keeps the SPANs inside the DIV regardless of padding.



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style>
  .row {
    background: red;
    width: 300px;
  }
  .label {
    color: white;
    background: green;
    padding: 5px;
  }
  .field {
    color: white;
    background: blue;
    padding: 5px;
  }
</style>
</head>
<body>


<div class="row">
<span class="label">label</span>
<span class="field">field</span>
</div>

</body>
</html>

Reproducible: Always
Keywords: testcase
I think this is probably correct behavior of Mozilla, the div class=row element
just needs to enclose the line boxes that are generated, and that is what
Mozilla is doing (padding isn't part of the line box)

It seems the info is given here:
http://www.w3.org/TR/CSS21/visuren.html#inline-formatting
http://www.w3.org/TR/CSS21/visudet.html#line-height
http://www.w3.org/TR/CSS21/visudet.html#inline-non-replaced

But I can't find a really satisfactory explanation.

By the way, Opera8 is doing the same as Mozilla.
Component: GFX → Layout
This is the right rendering for this CSS.  IE's handling of the inline box model
is known to be very very buggy.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: