Closed Bug 125619 Opened 23 years ago Closed 23 years ago

overlapping text and line-height CSS

Categories

(Core :: Layout, defect, P3)

x86
Windows 95
defect

Tracking

()

RESOLVED INVALID
Future

People

(Reporter: brackbillbruce, Assigned: attinasi)

Details

Attachments

(1 file)

In the following example assigned the font properties with the .recordContent class. I then reasign the font size to a paragraph using the inlined the STYLE attribute. This causes the text to overlap itself. When I remove the line-height from .recordContent, OR add a new line-height to the paragraphs STYLE attribute all is fine. It appears that the new size of font in the paragraph STYLE attribute is inheriting the existing line-height causing it to overlap. Is this desired behavior? If it is, then it seams to be a pain in the *ss to have to redecleare the line-height every time you change the font size. Also, asigningline heght and font at once (font: 25pxt/20px) does not work for me. Mozilla Build 2002020406 win 95 <html> <head> <style type="text/css"> .recordContent { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 120%} </style> <title> test page</title> </head> <body bgcolor="white" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0"> <table border="0" cellspacing="0" cellpadding="0" width="450"> <tr> <td valign="top" align="left" width="498"> <table border="0" cellspacing="10" cellpadding="0" width="100%"> <tr> <td class="recordContent"> <p> some bodyText </p> <p style="font-size:55pt"> <a href="http://mozilla.org">Mozilla</a>Some text that WRAPS a couple of lines and OVERLAPS itself. Some text that WRAPS a couple of lines and OVERLAPS</p> </td> </tr> </table> </td> </tr> </table> </body> </html>
Not a DOM problem, over to Layout.
Assignee: jst → attinasi
Component: DOM Style → Layout
QA Contact: ian → petersen
QA Contact: petersen → amar
Attached file testcase from reporter
Confirming the bug. Even IE overlaps the text. Attaching the testcase from the reporter.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Target Milestone: --- → Future
This occurs because you use a percentage value for line-height. Per CSS1, the value which results from the percentage, and not the percentage itself, is inherited, so it is not recalculated when you reset the font size. Use a numerical value for line-height, and this will work. Resolving INVALID.
Status: NEW → RESOLVED
Closed: 23 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: