Home > Article > Web Front-end > Some commonly used HTML tags and their usage
HTML (HyperText Markup Language) is a standard language for creating and publishing websites. HTML is defined based on a set of tags that describe the structure and content of a web page. In this article, we will introduce some commonly used HTML tags and their usage.
Six different levels of title tags are used in HTML to describe the content hierarchy of the document. From the highest level to the lowest level they are: h1, h2, h3, h4, h5, h6. Among them, h1 is the highest level and h6 is the lowest level. Generally, a page only uses one h1 tag, and other levels of tags are used to describe different levels of subtitles or content. Here is a simple example:
<h1>这是主标题</h1> <h2>这是次级标题</h2> <p>这是一段内容</p> <h3>这是三级标题</h3> <p>这是另一段内容</p>
In HTML, the
tag represents a paragraph and is used to break a block of text from above separated in a block. In a paragraph, spaces and carriage returns are only considered as single spaces. If you need to output multiple spaces in the same paragraph, you can use the space entity in HTML. If you need to force a line break, you can use the
tag.
<p>这是第一段的内容。 这是第一段的另一行文本。</p> <p>这是第二段的内容。</p> <p>这是第三段的内容。<br>这些是第三段的第二行。</p>
The tag in HTML is used to embed images in web pages. To use this tag, you need to provide the URL of the image and some properties, such as image size, border and text description.
<img src="image.jpg" alt="这是一张图片" width="500" height="500" border="1">
In HTML, the tag is used to create a hyperlink. The URL pointed to can be a page of the current website, another website, or any other material. When using the tag, you must provide the text of the hyperlink. The text can be any word or phrase you want users to see. In the tag, use the href (hyperlink reference) attribute to specify the URL of the link.
<a href="http://www.baidu.com">访问百度</a>
HTML contains two different list tags: unordered list and ordered list. In an unordered list (
<ul> <li>列表项1</li> <li>列表项2</li> <li>列表项3</li> </ul> <ol> <li>列表项1</li> <li>列表项2</li> <li>列表项3</li> </ol>
The table in HTML consists of three tags:
. Among them, the
|