Can comments appear before the DOCTYPE declaration?

前端 未结 5 1827
醉梦人生
醉梦人生 2020-11-27 15:39

I would like to place a comment ( style) at the very top of my HTML code, preceding the DOCTYPE declaration. Does this conform to the standar

5条回答
  •  北荒
    北荒 (楼主)
    2020-11-27 16:29

    Comments before the doctype are allowed, but cause all IE versions to revert to quirks mode. They are, actually, used for that purpose sometimes. The XML declaration () have the same effect, in IE6 and below.

提交回复
热议问题