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:
- HTML-CSS-JS Prettify
- HTML-CSS-JS Formatter
- Elm Format
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:
- Use Keyboard shortcut: Pressing Ctrl B (Windows/Linux) or Cmd B (Mac) will run and preview the HTML file using the preprocessor.
- Using the Sublime Text menu: Go to Tools > Build System > HTML and select Build. This will run the HTML file using the preprocessor and display the resulting 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!

SublimeText offers a free trial, but ultimately requires a paid purchase for a permanent authorization. 1) During the free trial period, users can experience its functions, but they will receive a purchase prompt. 2) After purchase, users can use it permanently, no subscription fee, and access more plug-ins and themes.

ThemaindifferencesbetweenthepaidandunpaidversionsofSublimeTextaretheremovalofstatusbarremindersandoccasionalpop-uppromptsinthepaidversion.1)Unregisteredversion:fullyfunctionalwithallcorefeatureslikesyntaxhighlighting,codecompletion,andcommandpalette,

SublimeText is worth buying. 1) Its simple interface and powerful functions, such as multi-line editing and GotoAnything, improve development efficiency. 2) Rich plug-in ecosystem, such as Anaconda, enhances the development experience. 3) Although the price is $70, its performance and fluency are great value for professional developers.

SublimeText is loved by developers for its powerful code completion and syntax highlighting capabilities. 1) Code completion can automatically prompt function names, variable names, etc. to improve programming efficiency. 2) Syntax highlighting distinguishes code elements through different colors to improve readability and error detection speed.

SublimeTextisidealforthosevaluingspeedandsimplicity,whileVSCodesuitsthoseneedingextensivefeaturesandcustomization.SublimeTextoffersquickfileaccesswith"GotoAnything"andaminimalisticapproach,butmaylackout-of-the-boxfunctionality.VSCodeprovide

SublimeTextisapowerfulcodingcompanionduetoitsspeed,customization,andkeyfeatures.1)Itoffersincrediblespeedforhandlinglargefiles.2)Itsflexibilityallowsextensivecustomizationwithpluginsandthemes.3)Featureslikemultiplecursors,GotoAnything,CommandPalette,

SublimeText is more suitable for users who work with large files and prefer lightweight editors, while VSCode is more suitable for users who need IDE capabilities and powerful scalability. 1.SublimeText is known for its speed and simplicity, and is suitable for handling large files. 2.VSCode is known for its scalability and Microsoft support, and is suitable for users who need IDE capabilities.

SublimeText is a powerful and flexible code editor that is worthy of exploration by programmers. 1) It supports multiple selection and editing, allowing multiple locations to be modified at the same time. 2) The plug-in system is rich and extensible. 3) The basic usage is intuitive, and the advanced usage includes regular expressions and macros. 4) Common errors such as plug-in conflicts can be resolved by uninstalling or adjusting the configuration. 5) Performance optimization is achieved through management plug-ins and configuration files.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Zend Studio 13.0.1
Powerful PHP integrated development environment

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Chinese version
Chinese version, very easy to use
