Can comments appear before the DOCTYPE declaration?

前端 未结 5 1811
醉梦人生
醉梦人生 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条回答
  •  萌比男神i
    2020-11-27 16:27

    While it's acceptable per the standard I believe, you definately want to avoid it, as it'll throw IE into quirks mode.

    (See Triggering different rendering modes)

提交回复
热议问题