Closed Bug 337194 Opened 18 years ago Closed 18 years ago

An img tag inside a td tag gets 4 pixels of extra padding on the bottom under HTML 4 strict

Categories

(Firefox :: File Handling, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 22274

People

(Reporter: plynchnlm, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3

When the HTML 4 strict DTD is specified, images that are inside a table's td tag get extra padding on the bottom.  This happens even when you specify cellpadding and cellspacing to be 0.

Reproducible: Always

Steps to Reproduce:
1.  Create an HTML file with the HTML 4 strict DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

2.  In the body section, include the following HTML table:
<table  border="0" cellpadding="0" cellspacing="0" style="background-color: blue"><tbody style="background-color: yellow;"><tr style="background-color: green"><td><img style="margin: 0px; padding: 0px; background-color: cyan;" src="Cmd_files/LtBlueLeft.gif"></td></tr></tbody></table>

3. Edit the img tag to point to an image accessible to your system


Actual Results:  
When the page displays, you should see four pixels of green padding below the image.

Expected Results:  
If it had displayed correctly, you would not see any green, just the image.

The work around I found is to wrap the img tag inside a div tag that has its height set to the height of the image.

*** This bug has been marked as a duplicate of 22274 ***
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.