Does my HTML5 doctype have to be on the VERY first line?

后端 未结 6 1241
心在旅途
心在旅途 2020-12-18 18:32

I\'ve always wondered whether whitespace before a DOCTYPE matters, but I can\'t seem to find any definitive information on the web. People say not to do it,

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-18 18:43

    Actually, the practical advice is to limit initial text that includes a statement to 1024 bytes. This is due to the need of some browsers to use a limited prescan to determine the character encoding quickly if a character encoding header is missing.

    See W3C and Sivonen for details.

提交回复
热议问题