Closed
Bug 199795
Opened 22 years ago
Closed 22 years ago
paragraph nested inside div results in extra space
Categories
(Core :: Layout: Block and Inline, defect)
Tracking
()
People
(Reporter: threedee15, Unassigned)
Details
Attachments
(1 file)
532 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4a) Gecko/20030329
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4a) Gecko/20030329
If a paragraph (<p></p>) is nested inside a div (<div></div>), the div will get
more space around it on the rendered page than a lone paragraph or a lone div
does. AFIAK (and in other browsers), divs should not add any extra space unless
they have padding or margins applied.
Reproducible: Always
Steps to Reproduce:
1. Render this HTML with Mozilla:
<div><p>Hello, world.</p></div>
2. Take out the <p> and </p> tags and try it again.
3. Try it with only the <p></p> tags and no divs.
Actual Results:
Extra space is inserted around the div element when it wraps around the paragraph.
In steps 2 and 3 above, the extra space is gone.
Expected Results:
Adding a div tag should not result in a change in where elements are placed on
the page.
This example uses tables to point out the extra space. In the first table is a
lone paragraph, in the second is a lone div, and in the third is a paragraph
nested inside a div, resulting in extra space.
This is because our quirks mode behavior for removing the margins at the
beginning and end of table cells doesn't pick up the p-inside-div case.
*** This bug has been marked as a duplicate of 33784 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•