In XHTML 1.0 Strict do attribute values need to be surrounded with quotes?

后端 未结 2 535
猫巷女王i
猫巷女王i 2021-01-20 17:42

In XHTML 1.0 Strict do attribute values need to be surrounded with quotes?

Example:


A

2条回答
  •  攒了一身酷
    2021-01-20 18:28

    From the XHTML 1.0 spec, they must always be quoted.

    All attribute values must be quoted, even those which appear to be numeric.


    From the HTML 4 spec, single quoted attributes are allowed.

    By default, SGML requires that all attribute values be delimited using either double quotation marks (ASCII decimal 34) or single quotation marks (ASCII decimal 39)

    The xhtml spec linked above lists the section as 'Differences from HTML 4', so since single quotes are not specifically disallowed, I think that means single quotes are allowed as well.

提交回复
热议问题