[thelist] what characters are allowed in class="..."?

Hassan Schroeder hassan.schroeder at gmail.com
Mon Dec 24 09:33:17 CST 2007


On Dec 24, 2007 5:06 AM, Zhang Weiwu <zhangweiwu at realss.com> wrote:

> I read the spec and understood it in a way that all characters except
> carrier-return and spaces are allowed to be used as class name:
> http://www.w3.org/TR/html4/struct/global.html#h-7.5.2

How you get "all characters" out of this:
<quote>
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 (".").
</quote>
:: I'm not sure, but yes, hyphens are OK.

> However vim often highlight it wrongly, e.g.
/
> gedit seems also think dash in css class name would be wrong

So you're using two editors with bugs. FWIW, your examples display
correctly in jEdit. Just one possible alternative :-)

HTH,
-- 
Hassan Schroeder ------------------------ hassan.schroeder at gmail.com



More information about the thelist mailing list