On 20 Oct 2006, at 12:41:02, Charles Roper wrote:
Hi,
Can anyone point me to a reference (or simply post here) of characters
that are valid to use in HTML class attribute values. I've searched
and searched but can't find a definitive list.
When in doubt, read the spec ;-)
HTML 4.01 defines the class attributes a being of type cdata-list:
<http://www.w3.org/TR/html4/struct/global.html#adef-class>
A cdata-list is a whitespace-separated collection of values
containing CDATA:
<http://www.w3.org/TR/html4/types.html#type-cdata>
which is a sequence of characters from the document character set
(which means anything you like if you're using UTF-8).
Note that the id attribute is defined as being of type name, which
has further restrictions applied to it, including being required to
begin with a letter (A-Z a-z), but the spec doesn't, in my
interpretation of it, impose the same constraint on classes.
Therefore "12345" would be a valid class name, but not a valid id.
Oh, and both class and id are case sensitive, so "fred" and "Fred"
are different.
HTH,
Nick.
--
Nick Fitzsimons
http://www.nickfitz.co.uk/
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************