Closed Bug 288373 Opened 20 years ago Closed 20 years ago

css or style tags do not get applied to elements with an ID that begins with a number

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 18936

People

(Reporter: tomashek, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2

If an element's ID begins with a number (<div ID="1a12">), styles that reference
the element by ID ( #1a12 {...} ) are not applied when viewed in Mozilla 1.7.6
or Firefox 1.0.2.  Viewed in IE 6.0, Opera, or Netscape, it is rendered
correctly.  Any very simple HTML page is an example:
<html><head><title></title><style type="text/css">
#1a12 {background-color: red; }</style></head>
<body id="1a12"><div id="2a12">Hello world</div></body></html>


Reproducible: Always

Steps to Reproduce:
1.  Attempt to reference any element by ID when the ID begins with a digit
2.
3.

Actual Results:  
style is not rendered

Expected Results:  
the style referenced should be applied to the element with the matching ID

Although the severity seems small, be able to render CSS correctly is a major
feature of any modern browser, so I'm going to call this a major problem.  You
can obviously overrule me if you want =).
http://www.w3.org/TR/html4/struct/global.html#h-7.5.2
http://www.w3.org/TR/html4/types.html#type-name

"ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by
any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons
(":"), and periods (".")."

Also see http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier

-> this bug is invalid
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Component: General → Style System (CSS)
Product: Mozilla Application Suite → Core
Version: unspecified → Trunk
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---

*** This bug has been marked as a duplicate of 18936 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: