Home >Web Front-end >HTML Tutorial >How to open the written html document with a browser
How to open an HTML document: 1. Create an HTML document; 2. Save the file as ".html"; 3. Open the browser; 4. Use the file menu; 5. Select the HTML file; 6. View your page.
How to open an HTML document in a browser
If you want to open an HTML document in a browser, it’s the easiest way The method is as follows:
Step 1: Create an HTML document
Use text editing software, such as Notepad or TextEdit, to create a new text file. Copy and paste the following code into the file:
<code class="html"><!DOCTYPE html> <html> <head> <title>我的第一个 HTML 页面</title> </head> <body> <h1>欢迎来到我的网站!</h1> <p>这是我编写的第一份 HTML 代码。</p> </body> </html></code>
Step 2: Save the file
Save the file as ".html". Make sure the file extension is correct, otherwise the browser will not be able to open the file.
Step 3: Open your browser
Open a web browser such as Chrome, Firefox or Edge.
Step 4: Use the File Menu
Click your browser’s File menu and select Open File or Open.
Step 5: Select the HTML file
In the Open File dialog box, navigate to the location where the HTML file is saved. Select the file and click Open.
Step 6: View your page
The HTML page you wrote should now display in your browser window.
The above is the detailed content of How to open the written html document with a browser. For more information, please follow other related articles on the PHP Chinese website!