单引号在HTML/XHTML中有效吗?
单引号在HTML中有效吗?更具体地说:XHTML严格单引号在HTML/XHTML中有效吗?,html,xhtml-1.0-strict,xhtml,Html,Xhtml 1.0 Strict,Xhtml,单引号在HTML中有效吗?更具体地说:XHTML严格 <table width="100%"> <table width='100%'> 是,单引号有效 从XML规范: [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'" [10]AttValue::=“”([^根据,两者都有效:-) [9]
<table width="100%">
<table width='100%'>
是,单引号有效 从XML规范:
[10] AttValue ::= '"' ([^<&"] | Reference)* '"'
| "'" ([^<&'] | Reference)* "'"
[10]AttValue::=“”([^根据,两者都有效:-)
[9]EntityValue::=“”([^%&“]| PEReference | Reference)*“”
|“([^%&']|参考资料)*”
[10] AttValue::=““”([^关于这件事的一个混乱来源似乎来自这篇文章
它似乎声称单引号在xhtml中无效。但是,由于没有引用任何规范,而且文章还声称禁止使用属性和元素的小写名称,作者可能只是表示编辑上禁止使用单引号。如果再次有疑问,您可以使用您的文档未经检查。
[9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"'
| "'" ([^%&'] | PEReference | Reference)* "'"
[10] AttValue ::= '"' ([^<&"] | Reference)* '"'
| "'" ([^<&'] | Reference)* "'"
[11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
[12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"