{"id":2511,"date":"2018-02-16T16:24:19","date_gmt":"2018-02-16T08:24:19","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=2511"},"modified":"2018-02-16T16:24:19","modified_gmt":"2018-02-16T08:24:19","slug":"html-doctype-%e7%9a%84%e4%bd%9c%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=2511","title":{"rendered":"html doctype \u7684\u4f5c\u7528"},"content":{"rendered":"<p>\n\t\u968f\u7740\u300a\u96be\u5fd8\u4eca\u5bb5\u300b\u8fd9\u9996\u6b4c\u7684\u54cd\u8d77\uff0c\u4ee3\u8868\u7740\u65e7\u7684\u4e00\u5e74\u5df2\u7ecf\u8fc7\u53bb\uff0c\u65b0\u7684\u4e00\u5e74\u5df2\u7ecf\u5230\u6765\u3002\n<\/p>\n<p>\n\t\u4eca\u5929\u662f\u5927\u5e74\u521d\u4e00\uff0c\u6211\u95f2\u7740\u65e0\u4e8b\u5728\u7f51\u4e0a\u7ee7\u7eed\u5b66\u4e60\u7f16\u7a0b\u77e5\u8bc6\uff0c\u770b\u5230 github \u4e0a\u4e00\u4f4d\u56fd\u5916\u7f51\u53cb\u5206\u4eab\u7684\u300a<a href=\"https:\/\/github.com\/yangshun\/front-end-interview-handbook\" name=\"\u524d\u7aef\u9762\u8bd5\u624b\u518c\" target=\"_blank\" title=\"\u524d\u7aef\u9762\u8bd5\u624b\u518c\">Front End Interview Handbook<\/a>\u300b\uff08\u8bd1\uff1a\u524d\u7aef\u9762\u8bd5\u624b\u518c\uff09\u5f88\u4e0d\u9519\uff0c\u5c31\u60f3\u9010\u6b65\u7ffb\u8bd1\u771f\u7406\u7ed9\u5927\u5bb6\u3002\u8ba9\u524d\u7aef\u7f51\u53cb\u5728\u65b0\u7684\u4e00\u5e74\u4e86\u627e\u5de5\u4f5c\u66f4\u5f97\u5fc3\u5e94\u624b\uff01\n<\/p>\n<p>\n\t\u4e0b\u9762\u662f\u6211\u7ffb\u8bd1\u8be5\u624b\u518c\u7684\u7b2c\u4e00\u4e2a\u95ee\u9898\uff1ahtml doctype \u7684\u4f5c\u7528\uff1f\n<\/p>\n<p>\n\tDOCTYPE\u662f&ldquo;\u6587\u4ef6\u7c7b\u578b&rdquo;\u7684\u7f29\u5199\u3002\u5b83\u4e3b\u8981\u7528\u6765\u533a\u5206 HTML \u6587\u6863\u7684 standards mode\uff08\u6807\u51c6\u6a21\u5f0f\uff09 \u548c&nbsp;<a href=\"https:\/\/quirks.spec.whatwg.org\/#history\" rel=\"nofollow\">quirks mode<\/a>\uff08\u602a\u5f02\u6a21\u5f0f\uff09\u3002\u5b83\u7684\u5b58\u5728\u544a\u8bc9\u6d4f\u89c8\u5668\u4ee5\u6807\u51c6\u6a21\u5f0f\u5448\u73b0\u7f51\u9875\u3002\n<\/p>\n<h2>\n\t&lt;!DOCTYPE&gt; \u58f0\u660e<br \/>\n<\/h2>\n<p>\n\tWeb \u4e16\u754c\u4e2d\u5b58\u5728\u8bb8\u591a\u4e0d\u540c\u7684\u6587\u6863\u3002\u53ea\u6709\u4e86\u89e3\u6587\u6863\u7684\u7c7b\u578b\uff0c\u6d4f\u89c8\u5668\u624d\u80fd\u6b63\u786e\u5730\u663e\u793a\u6587\u6863\u3002\n<\/p>\n<p>\n\tHTML \u4e5f\u6709\u591a\u4e2a\u4e0d\u540c\u7684\u7248\u672c\uff0c\u53ea\u6709\u5b8c\u5168\u660e\u767d\u9875\u9762\u4e2d\u4f7f\u7528\u7684\u786e\u5207 HTML \u7248\u672c\uff0c\u6d4f\u89c8\u5668\u624d\u80fd\u5b8c\u5168\u6b63\u786e\u5730\u663e\u793a\u51fa HTML \u9875\u9762\u3002\u8fd9\u5c31\u662f &lt;!DOCTYPE&gt; \u7684\u7528\u5904\u3002\n<\/p>\n<p>\n\t&lt;!DOCTYPE&gt; \u4e0d\u662f HTML \u6807\u7b7e\u3002\u5b83\u4e3a\u6d4f\u89c8\u5668\u63d0\u4f9b\u4e00\u9879\u4fe1\u606f\uff08\u58f0\u660e\uff09\uff0c\u5373 HTML \u662f\u7528\u4ec0\u4e48\u7248\u672c\u7f16\u5199\u7684\u3002\n<\/p>\n<p>\n\t\u6240\u6709\u6d4f\u89c8\u5668\u90fd\u652f\u6301 &lt;!DOCTYPE&gt; \u58f0\u660e\u3002\n<\/p>\n<h2>\n\t\u5b9a\u4e49\u548c\u7528\u6cd5<br \/>\n<\/h2>\n<p>\n\t&lt;!DOCTYPE&gt; \u58f0\u660e\u5fc5\u987b\u662f HTML \u6587\u6863\u7684\u7b2c\u4e00\u884c\uff0c\u4f4d\u4e8e &lt;html&gt; \u6807\u7b7e\u4e4b\u524d\u3002\n<\/p>\n<p>\n\t&lt;!DOCTYPE&gt; \u58f0\u660e\u4e0d\u662f HTML \u6807\u7b7e\uff1b\u5b83\u662f\u6307\u793a web \u6d4f\u89c8\u5668\u5173\u4e8e\u9875\u9762\u4f7f\u7528\u54ea\u4e2a HTML \u7248\u672c\u8fdb\u884c\u7f16\u5199\u7684\u6307\u4ee4\u3002\n<\/p>\n<p>\n\t\u5728 HTML 4.01 \u4e2d\uff0c&lt;!DOCTYPE&gt; \u58f0\u660e\u5f15\u7528 DTD\uff0c\u56e0\u4e3a HTML 4.01 \u57fa\u4e8e SGML\u3002DTD \u89c4\u5b9a\u4e86\u6807\u8bb0\u8bed\u8a00\u7684\u89c4\u5219\uff0c\u8fd9\u6837\u6d4f\u89c8\u5668\u624d\u80fd\u6b63\u786e\u5730\u5448\u73b0\u5185\u5bb9\u3002\n<\/p>\n<p>\n\tHTML5 \u4e0d\u57fa\u4e8e SGML\uff0c\u6240\u4ee5\u4e0d\u9700\u8981\u5f15\u7528 DTD\u3002\n<\/p>\n<h2>\n\tHTML 4.01 \u4e0e HTML5 \u4e4b\u95f4\u7684\u5dee\u5f02<br \/>\n<\/h2>\n<p>\n\t\u5728 HTML 4.01 \u4e2d\u6709\u4e09\u79cd &lt;!DOCTYPE&gt; \u58f0\u660e\u3002\u5728 HTML5 \u4e2d\u53ea\u6709\u4e00\u79cd\uff1a\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;!DOCTYPE html&gt;<\/pre>\n<h2>\n\t\u53c2\u8003\u8d44\u6599<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t<a href=\"https:\/\/stackoverflow.com\/questions\/7695044\/what-does-doctype-html-do\" rel=\"nofollow\"><font><font>https:\/\/stackoverflow.com\/questions\/7695044\/what-does-doctype-html-do<\/font><\/font><\/a>\n\t<\/li>\n<li>\n\t\t<a href=\"https:\/\/www.w3.org\/QA\/Tips\/Doctype\" rel=\"nofollow\"><font><font>https:\/\/www.w3.org\/QA\/Tips\/Doctype<\/font><\/font><\/a>\n\t<\/li>\n<li>\n\t\t<a href=\"https:\/\/quirks.spec.whatwg.org\/#history\" rel=\"nofollow\"><font><font>https:\/\/quirks.spec.whatwg.org\/#history<\/font><\/font><\/a>\n\t<\/li>\n<\/ul>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=2511\">html doctype \u7684\u4f5c\u7528<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u968f\u7740\u300a\u96be\u5fd8\u4eca\u5bb5\u300b\u8fd9\u9996\u6b4c\u7684\u54cd\u8d77\uff0c\u4ee3\u8868\u7740\u65e7\u7684\u4e00\u5e74\u5df2\u7ecf\u8fc7\u53bb\uff0c\u65b0\u7684\u4e00\u5e74\u5df2\u7ecf\u5230\u6765\u3002 \u4eca\u5929\u662f\u5927\u5e74\u521d\u4e00\uff0c\u6211\u95f2\u7740\u65e0\u4e8b\u5728\u7f51\u4e0a\u7ee7\u7eed [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[122,119,48,546,579],"class_list":["post-2511","post","type-post","status-publish","format-standard","hentry","category-html5","tag-html","tag-html5","tag-web","tag-546","tag-579"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2511"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2511\/revisions"}],"predecessor-version":[{"id":2512,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2511\/revisions\/2512"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}