HTML5 Compliant - Trailing Space in Class Attribute

后端 未结 4 2085
心在旅途
心在旅途 2021-01-12 22:20

I know that technically HTML5 is a \'living spec\' but I\'m wondering if it\'s compliant to have trailing spaces inside of a class name. I didn\'t see any reference to this

4条回答
  •  一整个雨季
    2021-01-12 22:38

    Yes, it is compliant.

    From http://www.w3.org/html/wg/drafts/html/master/dom.html#classes:

    The attribute, if specified, must have a value that is a set of space-separated tokens representing the various classes that the element belongs to.

    From http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#set-of-space-separated-tokens:

    A string containing a set of space-separated tokens may have leading or trailing space characters.

提交回复
热议问题