Create HTML document: Use a text editor to enter the HTML structure and save it as a .html file. Open an HTML document: Double-click the file or use the File > Open option in your browser. Practical example: Create a new HTML file, add a title, stylesheet and content, and save it as a .html file.
The basic structure of an HTML file is as follows:
<!DOCTYPE html> <html> <head> <title>我的 HTML 文档</title> </head> <body> </body> </html>
There are several ways to create HTML documents. An easy way is to use a text editor such as Notepad or Sublime Text.
.html
extension. For example, my_html_document.html
. To open HTML document, you can use the following method:
.html
file. This should open the file using your default web browser. Follow the following steps to create a simple web page and save it in a file:
<head>
section. <body>
section. .html
extension, such as index.html
. index.html
file or open it in a web browser to view your page. <!DOCTYPE html> <html> <head> <title>我的第一个网页</title> <style> body { font-family: Arial, sans-serif; font-size: 16px; } h1 { color: blue; } </style> </head> <body> <h1>欢迎来到我的第一个网页!</h1> <p>这是我使用 HTML 创建的第一个网页。我已经添加了一些文本、图像和链接来展示我能用 HTML 做什么。</p> <img src="image.jpg" alt="图片"> <a href="https://www.example.com">示例链接</a> </body> </html>
The above is the detailed content of Create and open HTML empty documents. For more information, please follow other related articles on the PHP Chinese website!