Run HTML: Install the HTML preprocessor (such as HTML-CSS-JS Prettify), configure user settings, and specify the preprocessor as the default ("html_prettify_on_save": true) to save the HTML file (.html) using the shortcut key (Ctrl B/Cmd B) or menu (Tools > Build System > HTML) to run and preview HTML files.
How to run HTML with Sublime Text
Sublime Text is a popular code editor for writing and Edit various programming languages, including HTML. To run HTML with Sublime Text, follow these steps:
Step 1: Install the HTML preprocessor
Sublime Text does not come with HTML by default for running HTML preprocessor. Therefore, you need to install one. There are several popular choices, such as:
Go to Package Control and search for the required preprocessor. Follow the instructions that appear to install.
Step 2: Configure User Settings
After installing the preprocessor, you need to configure the user settings for Sublime Text to designate it as the default preprocessor. Open Sublime Text's Preferences > Settings file and add the following line:
<code>"html_prettify_on_save": true</code>
Step 3: Save your HTML file
Write your HTML code and save it as a .html
file.
Step 4: Run the HTML file
There are two ways to run the HTML file in Sublime Text:
Note: To see how an HTML file will look in the browser, you will need to drag and drop the file into the browser window or manually enter the file into the browser address bar path.
The above is the detailed content of How to run html after writing code in sublime. For more information, please follow other related articles on the PHP Chinese website!