The Classes´ names aren´t parsed if they contain underscores ("_")

VERIFIED INVALID

Status

P3
normal
VERIFIED INVALID
18 years ago
14 years ago

People

(Reporter: dfuenzal, Assigned: asa)

Tracking

Trunk
x86
Windows 98

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

18 years ago
The Classes´ names in a style sheet (within a HTML document or in a separate file)
which contain underscores ("_") are not parsed, so this style:

  p.my_style{ color: #0000ff; }

is ignored.

I think it should be easy to work out.
Unfortunately, underscores are not allowed in class names by the CSS
specification.  They are reserved for future extensions to the language.
Reference: http://www.w3.org/TR/REC-CSS2/syndata.html#q4

Quote:

 In CSS2, identifiers  (including element names, classes, and IDs in selectors)
can contain only the characters [A-Za-z0-9] and ISO 10646 characters 161 and
higher, plus the hyphen (-); they cannot start with a hyphen or a digit. They
can also contain escaped characters and any ISO 10646 character as a numeric
code (see next item).

As you can see, underscores are not in the list of characters allowed in class
names.  So Mozilla is behaving correctly in ignoring syntactically incorrect CSS
rules.

Marking invalid.  You should replace underscores in your class names with a
legal character (a dash ('-') is good).

Status: UNCONFIRMED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → INVALID
hit the nail on the head.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.