单引号在HTML中有效吗?特别是:XHTML严格模式。
<table width="100%">
<table width='100%'>
单引号在HTML中有效吗?特别是:XHTML严格模式。
<table width="100%">
<table width='100%'>
是的,单引号是有效的。
来自XML规范:
[10] AttValue ::= '"' ([^<&"] | Reference)* '"'
| "'" ([^<&'] | Reference)* "'"
[9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"'
| "'" ([^%&'] | PEReference | Reference)* "'"
[10] AttValue ::= '"' ([^<&"] | Reference)* '"'
| "'" ([^<&'] | Reference)* "'"
[11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
[12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
而且W3C验证器也接受它。