What's a valid HTML5 document?

前端 未结 5 1893
醉梦人生
醉梦人生 2020-12-01 18:00

I\'ve just been reading the HTML5 author spec. It states that the , and tags are optional

5条回答
  •  有刺的猬
    2020-12-01 18:24

    The title element is indeed required, but as Jukka Korpela notes, it also must be non-empty. Furthermore, the content model of the title element is:

    Text that is not inter-element whitespace.

    Therefore, having just a space character in the title element is not considered valid HTML. You can check this in W3C validator.

    So, an example of a minimal and valid HTML5 document is the following:

    a
    

提交回复
热议问题