What is DOCTYPE?

后端 未结 8 1132
忘掉有多难
忘掉有多难 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:48

    Doctypes tell the browser in what language the page is written in, be it HTML or XHTML. For example,

    
    

    tell the browser to render the page as HTML4 strict. Older browsers used to render pages incorrectly and therefore newer browsers simulate errors of the older browsers when they find an old doctype.

    Today you should use at least HTML4 or better XHTML.

    A blog entry about doctypes is Fix Your Site With the Right DOCTYPE! (from A List Apart).

提交回复
热议问题