Welcome to the HTML tutorial section! Here you will learn the basics of HTML, which is the standard markup language for creating web pages. HTML is used to structure content on the web, and it is the foundation of all web development.
HTML 简介
HTML stands for HyperText Markup Language. It is a markup language that defines the structure of a web page. HTML uses tags to define elements such as headings, paragraphs, images, links, and more.
HTML 基础结构
Here is a basic structure of an HTML document:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<img src="image.jpg" alt="Image description">
</body>
</html>
In this structure, <!DOCTYPE html>
declares the document type and version of HTML. The <html>
element is the root element of an HTML page. The <head>
element contains meta-information about the document, such as the title. The <body>
element contains the content of the document.
HTML 标签
HTML uses tags to define elements. Tags are enclosed in angle brackets (< >
). For example, the <h1>
tag is used to define a heading.
常用 HTML 标签
Here are some commonly used HTML tags:
<h1>
to<h6>
: Define headings.<p>
: Define paragraphs.<a>
: Define hyperlinks.<img>
: Define images.<ul>
: Define an unordered list.<ol>
: Define an ordered list.<li>
: Define list items.
图片
To add an image to your HTML document, use the <img>
tag. You can specify the source of the image using the src
attribute, and provide a description for screen readers using the alt
attribute.
<img src="image.jpg" alt="Image description">
链接
To create a hyperlink, use the <a>
tag. The href
attribute specifies the URL of the link.
<a href="https://www.example.com">Visit Example.com</a>
总结
This tutorial provides a basic overview of HTML. To learn more about HTML and web development, visit our HTML Reference section.