This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 18090 - For ease of interoperability with CSS, suggest adding an authoring recommendation that id attribute values consist of the characters A-Z, a-z, 0-9, _, - and not begin with a dash.
Summary: For ease of interoperability with CSS, suggest adding an authoring recommenda...
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 17:14 UTC by contributor
Modified: 2012-09-14 09:59 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2012-07-18 17:14:36 UTC
This was was cloned from bug 16351 as part of operation convergence.
Originally filed: 2012-03-13 23:33:00 +0000

================================================================================
 #0   contributor@whatwg.org                          2012-03-13 23:33:00 +0000 
--------------------------------------------------------------------------------
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html
Multipage: http://www.whatwg.org/C#the-id-attribute
Complete: http://www.whatwg.org/c#the-id-attribute

Comment:
For ease of interoperability with CSS, suggest adding an authoring
recommendation that id attribute values consist of the characters A-Z, a-z,
0-9, _, - and not begin with a dash.

Posted from: 99.113.33.155
User agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2 Iceweasel/10.0.2
================================================================================
 #1   Simon Pieters                                   2012-03-14 07:49:58 +0000 
--------------------------------------------------------------------------------
Same with classes, I presume? What about data-* attribute names?

Note that the rule is:

"In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, two hyphens, or a hyphen followed by a digit."
================================================================================
Comment 1 Robin Berjon 2012-09-14 09:59:19 UTC
Same decision as https://www.w3.org/Bugs/Public/show_bug.cgi?id=16351.