Closed Bug 482014 Opened 17 years ago Closed 17 years ago

When setting color for anchors (a tags) in a CSS, the color gets applied to text after an empty anchor tag.

Categories

(Firefox :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: kalle.gustafsson, Unassigned)

Details

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2a1pre) Gecko/20090306 Minefield/3.2a1pre Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2a1pre) Gecko/20090306 Minefield/3.2a1pre When setting color for anchors (a tags) in a CSS, the color gets applied to text after an empty anchor tag. See other fields for details. Reproducible: Always Steps to Reproduce: 1. Save this as css.css: @CHARSET "UTF-8"; a { color: #101090; } 2. Save this as index.html: <html><head><link href="css.css" rel="stylesheet" type="text/css"/></head><body><h1><a id="1234"/>Title</h1><p>Text with <a href="foo">a link</a> and some text after it.</p></body></html> 3. Load index.html Actual Results: The text from Title up to and including the link text is blue. Expected Results: Only the link text should be blue. Reproduced with versions 3.2a1 linux x86_64, 3.0.7 linux i686 and 3.0.6 linux x86_64 (bundled with Ubuntu 8.10). No custom themes or anything in the browser.
Thanks for reporting, but this is no bug. In HTML (and XHTML sent as text/html), "<a/>" equals "<a>". This open <a> gets closed before </h1> and opened again after <p>, then it is closed a second time before the new <a> element. Here's a tip: use <h1 id="a1234">Text</h1> This is perfectly valid (IDs should start with a letter) and works in every browser.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.