{"id":21400,"date":"2024-11-19T15:16:09","date_gmt":"2024-11-19T07:16:09","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21400\/"},"modified":"2024-11-19T15:16:09","modified_gmt":"2024-11-19T07:16:09","slug":"vscode%e6%80%8e%e4%b9%88%e9%85%8d%e7%bd%aehtml","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21400\/","title":{"rendered":"vscode\u600e\u4e48\u914d\u7f6ehtml"},"content":{"rendered":"<blockquote><p>\n  \u8981\u914d\u7f6e vscode \u8fdb\u884c html \u5f00\u53d1\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u5b89\u88c5 html \u6269\u5c55\u914d\u7f6e html \u7247\u6bb5\u914d\u7f6e emmet \u7f29\u5199\u914d\u7f6e html \u7f8e\u5316\u914d\u7f6e\u5176\u4ed6\u8bbe\u7f6e\uff08\u53ef\u9009\uff09\u5b89\u88c5\u5176\u4ed6 html \u6269\u5c55\uff08\u53ef\u9009\uff09\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/27\/2024052714392743044.jpg\" class=\"aligncenter\" title=\"vscode\u600e\u4e48\u914d\u7f6ehtml\u63d2\u56fe\" alt=\"vscode\u600e\u4e48\u914d\u7f6ehtml\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5728 Visual Studio Code \u4e2d\u914d\u7f6e HTML<\/strong><\/p>\n<p>Visual Studio Code\uff08\u7b80\u79f0 VSCode\uff09\u662f\u4e00\u6b3e\u6d41\u884c\u7684\u6587\u672c\u7f16\u8f91\u5668\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff0c\u5305\u62ec HTML\u3002\u8981\u914d\u7f6e VSCode \u4ee5\u8fdb\u884c HTML \u5f00\u53d1\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u5b89\u88c5 HTML \u6269\u5c55<\/strong><\/p>\n<ul>\n<li>\u6253\u5f00 VSCode\u3002<\/li>\n<li>\u70b9\u51fb\u5de6\u4e0a\u89d2\u7684\u201c\u6269\u5c55\u201d\u56fe\u6807\u3002<\/li>\n<li>\u5728\u641c\u7d22\u680f\u4e2d\u8f93\u5165\u201cHTML\u201d\uff0c\u7136\u540e\u9009\u62e9\u5e76\u5b89\u88c5\u540d\u4e3a\u201cHTML (VSCode)\u201d\u7684\u6269\u5c55\u3002<\/li>\n<\/ul>\n<p><strong>2. \u914d\u7f6e HTML \u7247\u6bb5<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<ul>\n<li>\u5728 VSCode \u4e2d\uff0c\u6309 Ctrl+\/\uff08Windows\uff09\u6216 Cmd+\/\uff08Mac\uff09\u6253\u5f00\u547d\u4ee4\u9762\u677f\u3002<\/li>\n<li>\u8f93\u5165 Preferences: Open Settings (JSON)\uff0c\u7136\u540e\u6309 Enter\u3002<\/li>\n<li>\u5728\u6253\u5f00\u7684\u8bbe\u7f6e\u6587\u4ef6\u4e2d\uff0c\u627e\u5230 &#8220;emmet.includeLanguages&#8221; \u8bbe\u7f6e\uff0c\u5e76\u6dfb\u52a0 &#8220;html&#8221;\uff1a<\/li>\n<\/ul>\n<pre>\"emmet.includeLanguages\": [\"html\"]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u914d\u7f6e Emmet \u7f29\u5199<\/strong><\/p>\n<p>Emmet \u662f\u4e00\u79cd\u7f29\u5199\u6269\u5c55\uff0c\u53ef\u5e2e\u52a9\u60a8\u5feb\u901f\u751f\u6210 HTML \u4ee3\u7801\u3002\u8981\u5728 VSCode \u4e2d\u914d\u7f6e Emmet\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a<\/p>\n<ul>\n<li>\u5728\u8bbe\u7f6e\u6587\u4ef6\u4e2d\uff0c\u627e\u5230 &#8220;emmet.syntaxProfiles&#8221; \u8bbe\u7f6e\u3002<\/li>\n<li>\u6dfb\u52a0 &#8220;html&#8221; \u914d\u7f6e\uff1a<\/li>\n<\/ul>\n<pre>\"emmet.syntaxProfiles\": {\n  \"html\": {\n    \"tag_case\": \"lower\"\n  }\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>4. \u914d\u7f6e HTML \u7f8e\u5316<\/strong><\/p>\n<p>VSCode \u5185\u7f6e\u4e86 HTML \u7f8e\u5316\u529f\u80fd\u3002\u8981\u914d\u7f6e\u5b83\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a<\/p>\n<ul>\n<li>\u5728\u8bbe\u7f6e\u6587\u4ef6\u4e2d\uff0c\u627e\u5230 &#8220;html.format.contentUnformatted&#8221; \u8bbe\u7f6e\u3002<\/li>\n<li>\u5c06\u503c\u66f4\u6539\u4e3a true \u4ee5\u5ffd\u7565\u5185\u8054 Sass\u3001JS \u548c CSS \u4ee3\u7801\u7684\u683c\u5f0f\u5316\uff1a<\/li>\n<\/ul>\n<pre>\"html.format.contentUnformatted\": true<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>5. \u914d\u7f6e\u5176\u4ed6\u8bbe\u7f6e<\/strong><\/p>\n<p>\u5176\u4ed6\u53ef\u4ee5\u6839\u636e\u60a8\u7684\u504f\u597d\u8fdb\u884c\u914d\u7f6e\u7684\u6709\u7528\u8bbe\u7f6e\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>&#8220;html.automaticClosingTags&#8221;\uff1a\u81ea\u52a8\u5173\u95ed HTML \u6807\u7b7e\u3002<\/li>\n<li>&#8220;html.format.indentSize&#8221;\uff1a\u8bbe\u7f6e\u7f29\u8fdb\u5927\u5c0f\u3002<\/li>\n<li>&#8220;html.format.endWithNewline&#8221;\uff1a\u5728\u672b\u5c3e\u6dfb\u52a0\u6362\u884c\u7b26\u3002<\/li>\n<\/ul>\n<p><strong>6. \u5b89\u88c5\u5176\u4ed6 HTML \u6269\u5c55\uff08\u53ef\u9009\uff09<\/strong><\/p>\n<ul>\n<li> <strong>HTML Snippets<\/strong>\uff1a\u63d0\u4f9b\u989d\u5916\u7684 HTML \u4ee3\u7801\u7247\u6bb5\u3002<\/li>\n<li> <strong>HTML Lint<\/strong>\uff1a\u8bc6\u522b\u5e76\u7a81\u51fa\u663e\u793a HTML \u4e2d\u7684\u8bed\u6cd5\u9519\u8bef\u3002<\/li>\n<li> <strong>Live Server<\/strong>\uff1a\u5728\u6d4f\u89c8\u5668\u4e2d\u5b9e\u65f6\u9884\u89c8 HTML \u6587\u4ef6\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u914d\u7f6ehtml\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8981\u914d\u7f6e vscode \u8fdb\u884c html \u5f00\u53d1\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u5b89\u88c5 html \u6269\u5c55\u914d\u7f6e html \u7247\u6bb5\u914d\u7f6e emmet \u7f29\u5199\u914d\u7f6e html \u7f8e\u5316\u914d\u7f6e\u5176\u4ed6\u8bbe\u7f6e\uff08\u53ef\u9009\uff09\u5b89\u88c5\u5176\u4ed6 html \u6269\u5c55\uff08\u53ef\u9009\uff09 \u5728 Visual Studio Code \u4e2d\u914d\u7f6e HTML Visual Studio Code\uff08\u7b80\u79f0 VSCode\uff09\u662f\u4e00\u6b3e\u6d41\u884c\u7684\u6587\u672c\u7f16\u8f91\u5668\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff0c\u5305\u62ec HTML\u3002\u8981\u914d\u7f6e VSCode \u4ee5\u8fdb\u884c HTML \u5f00\u53d1\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u5b89\u88c5 HTML \u6269\u5c55 \u6253\u5f00 VSCode\u3002 \u70b9\u51fb\u5de6\u4e0a\u89d2\u7684\u201c\u6269\u5c55\u201d\u56fe\u6807\u3002 \u5728\u641c\u7d22\u680f\u4e2d\u8f93\u5165\u201cHTML\u201d\uff0c\u7136\u540e\u9009\u62e9\u5e76\u5b89\u88c5\u540d\u4e3a\u201cHTML (VSCode)\u201d\u7684\u6269\u5c55\u3002 2. \u914d\u7f6e HTML \u7247\u6bb5 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u5728 VSCode \u4e2d\uff0c\u6309 Ctrl+\/\uff08Windows\uff09\u6216 Cmd+\/\uff08Mac\uff09\u6253\u5f00\u547d\u4ee4\u9762\u677f\u3002 \u8f93\u5165 Preferences: Open Settings (JSON)\uff0c\u7136\u540e\u6309 Enter\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-21400","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=21400"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21400\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}