HTML类中的管道字符 [英] Pipe Chars in HTML Classes
本文介绍了HTML类中的管道字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在W3C文档中找不到任何不允许使用管道字符 | 的内容,例如:
I couldn't find anything in the W3C docs that said pipe chars, |, aren't allowed, for instance:
<div class="class1|class2">
不用担心我会用它做什么.我只是想知道它是否合法".
Don't worry about what I might be using it for. I was just wondering if it's "legal".
推荐答案
相关规则可以在 w3c同步数据标记化部分,尽管很难从那里得出管道是否有效的信息,乍一看似乎对选择器来说任何东西都是有效的,即:
The relevant rules can be found in w3c syndata tokenization section, though it's pretty difficult to conclude from there if pipe is valid or not, as per a glance, it seems that anything is valid for a selector, i.e.:
selector : any+;
any : [ IDENT | NUMBER | PERCENTAGE | DIMENSION | STRING
| DELIM | URI | HASH | UNICODE-RANGE | INCLUDES
| DASHMATCH | ':' | FUNCTION S* any* ')'
| '(' S* any* ')' | '[' S* any* ']' ] S*;
这篇关于HTML类中的管道字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文