


A brief discussion of html semantic tags, Html5 new semantic tags_html/css_WEB-ITnose
Html semantic tags, new semantic tags in Html5
During my study, I compiled some knowledge about semantic tags in HTML, but the list is not comprehensive.
I hope you all have it If you have any new insights, you can leave me a message and I will add them. Thank you all
1. What are semantic tags?
So what is semantic tags? To put it simply, understand each tag. The purpose of each tag (under what circumstances can I use this tag?) For example,
The title of the article on the webpage can use the title tag, and the of each column on the webpage can be used 🎜>Column nameYou can also use title tags.
The content paragraphs in the article must be placed in the paragraph tag . If there is text that you want to emphasize in the article, you can use the em tag to express emphasis, etc.
2. Why use semantic tags?
1. It is easier to be indexed by search engines.
2. Make it easier for screen readers to read web content.
3. Can better reflect the theme of the page
4. Better compatibility, supports more network devices
3.html semantic tags
Emphasize: the role of the title attribute. When the mouse slides over the link text, the text content of this attribute will be displayed. This attribute plays a great role in actual web development. It mainly facilitates search engines to understand the content of the link address (more semantically friendly)
2):
tag: Article paragraphs are placed in the
tags
3):
title tag There are 6 in total, h1, h2, h3, h4, h5, and h6 are first-level headings, second-level headings, third-level headings, fourth-level headings, fifth-level headings, and sixth-level headings respectively. And in descending order of importance.
is the highest level.
4): and tags: emphasize certain words
but both There is a difference in the tone of emphasis: means emphasis, means stronger emphasis. And in the browser, is represented by italic by default, and is represented by bold.
Compared with the two tags, domestic front-end programmers currently prefer to use to express emphasis.
5): Tag: short text quote
Note that the text to be quoted does not need to be enclosed in double quotes , the browser will The q tag automatically adds double quotes
6):
tag: long text quoteNote that the browser does not accept <blockquote> The parsing of the tag is indentation style
7):
tag: add address information to the web page
8):
Tag: unordered list
9):
Tag: ordered list
10 ):
Tag: Add a title and summary to the table The content of the summary will not be displayed in the browser. Its function is to increase the readability (semanticization) of the table, enable search engines to better understand the table content, and also enable screen readers to better help special users read the table content.
Grammar:
The title is used to describe the content of the table. The title is displayed at the top of the table.
Syntax:
title text
4.Html5 semantic tags
1):article tag: Load and display an independent article content.
For example, a complete forum post, a website news, a blog article, etc., a user comment, etc. artilce can be nested, then the inner artilce has a subordinate relationship with the outer article tag .
For example, a blog post can be displayed as article, and then some comments can be embedded in it in the form of article.
<article><h1>文章标题</h1>这是一篇文章 <article>评论1...</article> <article>评论2...</article></article>Copy after login
2):section tag: Define the section (section, section) in the document. Such as chapters, headers, footers, or other parts of the document.
Example:
<section> <h1>章节一</h1> <p>详细内容...</p></section><section> <h1>章节二</h1> <p>详细内容...</p></section>Copy after login3): aside tag: used to load non-text content. Such as ads, groups of links, sidebars, etc.
4): hgroup tag: used to combine title elements (h1-h6) of web pages or sections.
For example, if you have consecutive h-series tag elements in a section, you can enclose them with hgroup.
<hgroup><h1>标题1</h1><h2>标题2</h2></hgroup>Copy after login
5): header tag: defines the page combination of the document, usually some guidance and navigation information.
6):footer tag: defines the footer of section or document.
Typically, this element will contain the author's name, the date the document was created, and/or contact information.
Example:
<footer> © 2012 Baidu 使用百度前必读 京ICP证030173号 </footer>Copy after login
7):nav 标签:导航链接放在nav标签里。
nav标签里应该放入一些当前页面的主要导航链接。
例如在页脚显示一个站点的导航链接(如首页,服务信息页面,版权信息页面等等),就可以使用nav标签,当然,这不是必须的。
8):time 标签:定义公历的时间(24 小时制)或日期,时间和时区偏移是可选的。
该元素能够以机器可读的方式对日期和时间进行编码,搜索引擎也能够生成更智能的搜索结果
9):mark 标签:定义带有记号的文本。请在需要突出显示文本时使用 标签。
10):figure标签:规定独立的流内容(图像、图表、照片、代码等等)。
figure 元素的内容应该与主内容相关,但如果被删除,则不应对文档流产生影响。
11):figcaption 标签:定义 figure 元素的标题(caption)。
"figcaption" 元素应该被置于 "figure" 元素的第一个或最后一个子元素的位置。
实例:
<figure> <figcaption>美女图片</figcaption> <img src="meizi.jpg" width="350" height="234" /></figure>Copy after login
Statement of this WebsiteThe content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn![]()
Hot AI Tools
![]()
Undresser.AI Undress
AI-powered app for creating realistic nude photos
![]()
AI Clothes Remover
Online AI tool for removing clothes from photos.
![]()
Undress AI Tool
Undress images for free
![]()
Clothoff.io
AI clothes remover
![]()
Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!
![]()
Hot Article
What's New in Windows 11 KB5054979 & How to Fix Update Issues4 weeks ago By DDDHow to fix KB5055523 fails to install in Windows 11?3 weeks ago By DDDInZoi: How To Apply To School And University4 weeks ago By DDDHow to fix KB5055518 fails to install in Windows 10?3 weeks ago By DDDWhere to find the Site Office Key in Atomfall4 weeks ago By DDD![]()
Hot Tools
![]()
Notepad++7.3.1
Easy-to-use and free code editor
![]()
SublimeText3 Chinese version
Chinese version, very easy to use
![]()
Zend Studio 13.0.1
Powerful PHP integrated development environment
![]()
Dreamweaver CS6
Visual web development tools
![]()
SublimeText3 Mac version
God-level code editing software (SublimeText3)
![]()
Hot Topics
See all articlesIs HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM
HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.
The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM
HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.
Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM
WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.
Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Apr 04, 2025 pm 11:54 PM
GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...
What is an example of a starting tag in HTML? Apr 06, 2025 am 12:04 AM
AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.
How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? Apr 05, 2025 am 06:15 AM
To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...
HTML, CSS, and JavaScript: Essential Tools for Web Developers Apr 09, 2025 am 12:12 AM
HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.
How to implement adaptive layout of Y-axis position in web annotation? Apr 04, 2025 pm 11:30 PM
The Y-axis position adaptive algorithm for web annotation function This article will explore how to implement annotation functions similar to Word documents, especially how to deal with the interval between annotations...
![]()