<a name="" /> causes bad CSS interpretation, but <a name=""></a> works - see attached example

RESOLVED DUPLICATE of bug 225323

Status

()

Core
CSS Parsing and Computation
RESOLVED DUPLICATE of bug 225323
13 years ago
13 years ago

People

(Reporter: Ryan Holliday, Assigned: dbaron)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

744 bytes, application/x-zip-compressed
Details
(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040421
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040421

I have a stylesheet containing the following:

#bug {
	margin: 5px 0 5px 0;
}
#bug .bug-item {
	border: 1px solid black;
}
#bug .bug-item a {
	color: blue;
}

The following HTML code will display text that should be black using the "#bug
.bug-item a" rules:

<div id="bug">
		<a name="buggy" />
		<div class="bug-item">

			<p>black black black <a href="http://www.mozilla.org/">blue</a> black black
black.</p>

		</div>
</div>


Changing "<a name="buggy" />" to "<a name="buggy"></a>" fixes the problem.

Sample HTML and CSS file attached.

Reproducible: Always
Steps to Reproduce:
View the attached file.  The text "black" should be black, but it is rendered as
blue.  Changing "<a name="name" />" to "<a name="name"></a>" fixes the problem.
Actual Results:  
Text is blue.

Expected Results:  
Text should be black.
(Reporter)

Comment 1

13 years ago
Created attachment 146940 [details]
This HTML & CSS demonstrate the problem.

HTML & CSS file to demonstrate the bug.

Comment 2

13 years ago
You can't use that syntax when writing XHTML and serving it as text/html.

See bug 225323 comment 5.

*** This bug has been marked as a duplicate of 225323 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → DUPLICATE
(Reporter)

Comment 3

13 years ago
Created attachment 146942 [details]
[CORECTED] HTML & CSS to Demonstrate the Problem

Sorry, the last attachment got mangled by trying to a "Save Page As".  This one
should be correct.
(Reporter)

Updated

13 years ago
Attachment #146940 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.