Closed Bug 222333 Opened 21 years ago Closed 21 years ago

Images embedded in tables get a 5px margin at the bottom when using XHTML Strict

Categories

(Core :: Layout: Tables, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: colin.leitner, Unassigned)

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 1.0.3705)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.5) Gecko/20030925

When using XHTML Strict a plain image in a table cell gets a 5px margin at the 
bottom. XHTML Transitional works fine. Changing the td or img padding/margin 
has no effect. Only bigger margins/paddings work (but with a +5 offset).

Reproducible: Always

Steps to Reproduce:
1.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Wierd XHTML+Gecko+IMG display bug (?)</title>
	</head>
	<body>
		<table>
			<tr>
				<td style="background-color: green;">
					<img alt="Some image" 
src="http://www.google.com/images/logo.gif" style="margin-bottom: 0px;"/>
				</td>
			</tr>
		</table>
	</body>
</html>
2.
Change the DOCTYPE to
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Actual Results:  
The image gets a 5px margin at the bottom.

Expected Results:  
Use the default/set margin and let it be changed.
This is correct and intended behavior.  See
http://devedge.netscape.com/viewsource/2002/img-table/ for why.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
This is due to a different interpretation of the CSS-standard. See bug 22274
comment 17. The full explanation can be found here :
http://devedge.netscape.com/viewsource/2002/img-table/

Workaround :
- use the "display: block;" style for all images
- or use the 'almost standards' mode, which is identical to the strict mode, but
which fixes this problem. See
http://devedge.netscape.com/viewsource/2002/almost-standards/
Actually, this is a duplicate of bug 22274, plain and simple..
You need to log in before you can comment on or make changes to this bug.