HTML has become an indispensable part of our daily life, so how do we run HTML on different occasions? Below, this article will introduce it to you in detail.
1. Run HTML on the local computer
The most convenient way for us to open local HTML files is to Open it in your browser. This is because the browser is one of the most compatible applications for HTML files. If your HTML file uses other technologies such as CSS and JS, the browser can also interpret them correctly and render them as the final web page.
Running the HTML file on a local server is a more advanced but more complex method. In this method, we need to install a local server (such as XAMPP and WampServer, etc.) first. Of course, this service is free. After the installation is complete, place the HTML file in the root directory of the server and enter "localhost" or "127.0.0.1" in the browser to access the web page.
If you are a programmer, you can use some tools to write, edit, run and test HTML files, such as Sublime Text, Visual Studio Code or Notepad. In these tools, you can use the preview function they provide to view the running effect of the HTML file online.
2. Run HTML on the remote server
Running the HTML file on the remote server is faster than More convenient on local computer. In this method, we only need to upload the HTML file to the server and enter the server's URL in the browser to view and access the HTML file.
If you want to run HTML files on a remote server, you need to use FTP tools to upload the files to the server. You can use common FTP tools like FileZilla and WinSCP. After the upload is completed, enter the server URL in the browser to view the HTML file.
Uploading HTML files from the command line is an advanced solution for programmers. In this method, we need to log in to the terminal on the server and then use the command ftp to upload the HTML file. This method requires some computer skills, but is a good solution for users who want to perform batch tasks efficiently.
Summary
HTML is a very useful technology, and understanding how to run HTML files on local and remote servers is necessary for anyone involved in web development. In addition, no matter which method is used, we need to understand the basics of web servers and FTP transfers to ensure that we can use HTML files in a safe, reliable and efficient environment.
The above is the detailed content of How to run html. For more information, please follow other related articles on the PHP Chinese website!