{"id":21655,"date":"2024-11-19T13:01:02","date_gmt":"2024-11-19T05:01:02","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21655\/"},"modified":"2024-11-19T13:01:02","modified_gmt":"2024-11-19T05:01:02","slug":"vscode%e6%80%8e%e6%a0%b7%e5%88%9b%e5%bb%baweb%e9%a1%b9%e7%9b%ae","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21655\/","title":{"rendered":"vscode\u600e\u6837\u521b\u5efaweb\u9879\u76ee"},"content":{"rendered":"<blockquote><p>\n  \u5728 vs code \u4e2d\u521b\u5efa web \u9879\u76ee\u9700\u8981\uff1a\u5b89\u88c5\u5fc5\u9700\u7684\u6269\u5c55\uff1ahtml\u3001css\u3001javascript \u548c live server\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\u5939\uff0c\u4fdd\u5b58\u9879\u76ee\u6587\u4ef6\u3002\u521b\u5efa index.html\u3001style.css \u548c script.js \u6587\u4ef6\u3002\u8bbe\u7f6e\u5b9e\u65f6\u670d\u52a1\u5668\u3002\u8f93\u5165 html\u3001css \u548c javascript \u4ee3\u7801\u3002\u8fd0\u884c\u9879\u76ee\uff0c\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/25\/2024062503374331457.jpg\" class=\"aligncenter\" title=\"vscode\u600e\u6837\u521b\u5efaweb\u9879\u76ee\u63d2\u56fe\" alt=\"vscode\u600e\u6837\u521b\u5efaweb\u9879\u76ee\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 VS Code \u4e2d\u521b\u5efa Web \u9879\u76ee<\/strong><\/p>\n<p><strong>1. \u5b89\u88c5\u5fc5\u9700\u7684\u6269\u5c55<\/strong><\/p>\n<ul>\n<li>HTML<\/li>\n<li>CSS<\/li>\n<li>JavaScript<\/li>\n<li>Live Server<\/li>\n<\/ul>\n<p><strong>2. \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6\u5939<\/strong><\/p>\n<ul>\n<li>\u5728 VS Code \u4e2d\uff0c\u8f6c\u5230\u201c\u6587\u4ef6\u201d&gt;\u201c\u65b0\u5efa\u201d&gt;\u201c\u6587\u4ef6\u5939\u201d\u3002<\/li>\n<li>\u4e3a\u60a8\u7684\u9879\u76ee\u547d\u540d\u5e76\u9009\u62e9\u4e00\u4e2a\u4f4d\u7f6e\u3002<\/li>\n<\/ul>\n<p><strong>3. \u521b\u5efa index.html \u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\u5728\u9879\u76ee\u6587\u4ef6\u5939\u4e2d\u53f3\u952e\u5355\u51fb\uff0c\u7136\u540e\u9009\u62e9\u201c\u65b0\u5efa\u201d&gt;\u201c\u6587\u4ef6\u201d\u3002<\/li>\n<li>\u5c06\u6587\u4ef6\u547d\u540d\u4e3a\u201cindex.html\u201d\u3002<\/li>\n<li>\u5982\u679c\u770b\u5230\u63d0\u793a\uff0c\u8bf7\u9009\u62e9\u5c06\u6587\u4ef6\u7f16\u7801\u4e3a\u201cUTF-8\u201d\u3002<\/li>\n<\/ul>\n<p><strong>4. \u521b\u5efa CSS \u548c JavaScript \u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\u91cd\u590d\u6b65\u9aa4 3\uff0c\u5206\u522b\u521b\u5efa\u540d\u4e3a\u201cstyle.\u201d\u548c\u201cscript.js\u201d\u7684\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<p><strong>5. \u8bbe\u7f6e\u5b9e\u65f6\u670d\u52a1\u5668<\/strong><\/p>\n<ul>\n<li>\u5728 VS Code \u6d3b\u52a8\u680f\u4e2d\uff0c\u5355\u51fb\u201cLive Server\u201d\u3002<\/li>\n<li>\u5355\u51fb\u201c\u542f\u52a8 Live Server\u201d\u6309\u94ae\u3002<\/li>\n<\/ul>\n<p><strong>6. \u8f93\u5165\u4ee3\u7801<\/strong><\/p>\n<ul>\n<li>\u5728\u201cindex.html\u201d\u6587\u4ef6\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/li>\n<\/ul>\n<pre>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n  &lt;link rel=\"stylesheet\" href=\"style.css\"&gt;\n  &lt;script src=\"script.js\"&gt;&lt;\/script&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;h1&gt;Hello, World!&lt;\/h1&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u5728\u201cstyle.css\u201d\u6587\u4ef6\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/li>\n<\/ul>\n<pre>body {\n  background-color: blue;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u5728\u201cscript.js\u201d\u6587\u4ef6\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/li>\n<\/ul>\n<pre>console.log(\"Hello, World!\");<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>7. \u8fd0\u884c\u9879\u76ee<\/strong><\/p>\n<ul>\n<li>\u5728\u6d3b\u52a8\u680f\u4e2d\uff0c\u5355\u51fb\u201cLive Server\u201d&gt;\u201c\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u201d\u3002<\/li>\n<li>\u60a8\u7684\u9879\u76ee\u5c06\u5728\u9ed8\u8ba4\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\uff0c\u663e\u793a\u4e00\u4e2a\u5e26\u6709\u84dd\u8272\u80cc\u666f\u548c\u663e\u793a\u201cHello, World!\u201d\u7684\u9875\u9762\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u6837\u521b\u5efa\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>\u5728 vs code \u4e2d\u521b\u5efa web \u9879\u76ee\u9700\u8981\uff1a\u5b89\u88c5\u5fc5\u9700\u7684\u6269\u5c55\uff1ahtml\u3001css\u3001javascript \u548c live server\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\u5939\uff0c\u4fdd\u5b58\u9879\u76ee\u6587\u4ef6\u3002\u521b\u5efa index.html\u3001style.css \u548c script.js \u6587\u4ef6\u3002\u8bbe\u7f6e\u5b9e\u65f6\u670d\u52a1\u5668\u3002\u8f93\u5165 html\u3001css \u548c javascript \u4ee3\u7801\u3002\u8fd0\u884c\u9879\u76ee\uff0c\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u3002 \u5982\u4f55\u5728 VS Code \u4e2d\u521b\u5efa Web \u9879\u76ee 1. \u5b89\u88c5\u5fc5\u9700\u7684\u6269\u5c55 HTML CSS JavaScript Live Server 2. \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6\u5939 \u5728 VS Code \u4e2d\uff0c\u8f6c\u5230\u201c\u6587\u4ef6\u201d&gt;\u201c\u65b0\u5efa\u201d&gt;\u201c\u6587\u4ef6\u5939\u201d\u3002 \u4e3a\u60a8\u7684\u9879\u76ee\u547d\u540d\u5e76\u9009\u62e9\u4e00\u4e2a\u4f4d\u7f6e\u3002 3. \u521b\u5efa index.html \u6587\u4ef6 \u5728\u9879\u76ee\u6587\u4ef6\u5939\u4e2d\u53f3\u952e\u5355\u51fb\uff0c\u7136\u540e\u9009\u62e9\u201c\u65b0\u5efa\u201d&gt;\u201c\u6587\u4ef6\u201d\u3002 \u5c06\u6587\u4ef6\u547d\u540d\u4e3a\u201cindex.html\u201d\u3002 \u5982\u679c\u770b\u5230\u63d0\u793a\uff0c\u8bf7\u9009\u62e9\u5c06\u6587\u4ef6\u7f16\u7801\u4e3a\u201cUTF-8\u201d\u3002 4. \u521b\u5efa CSS \u548c JavaScript \u6587\u4ef6 \u91cd\u590d\u6b65\u9aa4 3\uff0c\u5206\u522b\u521b\u5efa\u540d\u4e3a\u201cstyle.\u201d\u548c\u201cscript.js\u201d\u7684\u6587\u4ef6\u3002 5. \u8bbe\u7f6e\u5b9e\u65f6\u670d\u52a1\u5668 \u5728 [&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-21655","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21655","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=21655"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21655\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}