What is DOCTYPE?

后端 未结 8 989
忘掉有多难
忘掉有多难 2020-11-22 16:20
  • What is DOCTYPE and why do I want to use it?
  • What are the different DOCTYPEs I can use?
  • What is the difference between standards and quirks mode, and
8条回答
  •  粉色の甜心
    2020-11-22 16:34

    On the web, a doctype does nothing but tell the brower if you want standards, almost standards, or quirks mode.

    What changes in quirks mode depends on the browser: Firefox, Opera, Safari, and Chrome implement a limited set of quirks, like removing the space for text descenders in code like

    (solution: td img { vertical-align:bottom; }). IE, on the other hand, reverts to the rendering engine in IE5.5. That means that you won't be able to use any of the new features implemented since 2000.

    To trigger standards mode, I suggest using the HTML5 doctype, , as it is the easiest to remember.

提交回复
热议问题