Open Bug 297390 Opened 20 years ago Updated 2 years ago

2 pixels padding under block or display:block elements

Categories

(Core :: Layout, defect)

x86
Windows XP
defect

Tracking

()

People

(Reporter: omonaco, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Show the space under the underline of "a". It is not the same on the two lines :
firefox adds 2 pixels to a "forced" block element. I use a "em" element but any
inline element can be used.

There is the same problem with "natural" block elements like a div. Using the
div as-is put a space 2 pixels higher than using div with CSS property "display"
to "inline".

IE 6 and Opera 8 do not create this 2 pixels padding. Who is wrong ?

Reproducible: Always

Steps to Reproduce:
Use this XHTML code source :

<?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" lang="fr" xml:lang="fr">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title></title>
  <style type="text/css">
		em#normal {
			background: #FF0000;
			text-decoration: underline;
		}
		em#block {
			display: block;
			background: #FF0000;
			text-decoration: underline;
		}
  </style>
</head>
<body>
<p><em id="normal">a</em></p>
<p><em id="block">a</em></p>
</body>
</html>

Actual Results:  
The background of the second line is 2 pixels higher than the background of the
first line.

Expected Results:  
W3 recommandations seem to not contain directives but I seems to be natural that
the height of the background should be the than on the 2 lines. 

The problem does not seem to be linked to XHTML or the way Firefox render XHTML.
Removing any DOCTYPE or XHTML information change nothing.
Seing the extra pixels under the second link in the second block using a trunk
bulid (20050611, win xp)
Severity: minor → normal
Component: General → Layout
Keywords: testcase
Product: Firefox → Core
QA Contact: general → layout
Version: unspecified → Trunk
Attached file Testcase
Status: UNCONFIRMED → NEW
Ever confirmed: true
I'm not seeing this on Linux.  Is this Windows-only?

I'm seeing a difference in number of red pixels underneath the underline of the two elements on Linux, when zoomed in to 500%

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: