简体   繁体   English

如何在 Sublime Text 3 中运行 HTML、CSS 和 JavaScript 代码?

[英]How to run HTML, CSS and JavaScript codes in Sublime Text 3?

With using Ctrl+BI see this error: No Build System.使用 Ctrl+BI 会看到此错误:No Build System。 What should I do to run my codes and What packages Should I install?我应该怎么做才能运行我的代码以及我应该安装哪些软件包?

You can set up Chrome as a build system in Sublime:您可以在 Sublime 中将 Chrome 设置为构建系统:

  1. Go to Tools -> Build System转到工具->构建系统
  2. Choose New Build System .选择新建构建系统 This should open up a new file.这应该打开一个新文件。
  3. Delete everything in that file, and copy the following command in (where PATH_TO_CHROME is replaced by the path to Chrome on your system):删除该文件中的所有内容,并将以下命令复制到(其中PATH_TO_CHROME替换为系统上 Chrome 的路径):

     { "cmd":["PATH_TO_CHROME","$file"] }
  4. Save the file as Chrome.sublime-build将文件另存为Chrome.sublime-build
  5. Close Sublime, and then open it again关闭 Sublime,然后再次打开它
  6. If you go to Tools -> Build System now, you should now see Chrome as an option.如果您现在转到Tools -> Build System ,您现在应该看到Chrome作为一个选项。 Select it.选择它。
  7. Now, whenever you hit ctrl + B , it will open your HTML in Chrome.现在,只要你按下ctrl + B ,它就会在 Chrome 中打开你的 HTML。

首先,您应该将文件另存为 HTML 文件,然后右键单击并在浏览器中打开它。

You can just open your HTML file in a browser.您只需在浏览器中打开 HTML 文件即可。 Locate the HTML file on your computer, right click, open with { whatever browser you use }.在您的计算机上找到 HTML 文件,右键单击,使用 { 使用的任何浏览器} 打开。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM