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
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.
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
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.
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
Related labels:source:php.cnPrevious article:JSTL function tag library fn tag_html/css_WEB-ITnose Next article:RGB color table_html/css_WEB-ITnoseStatement 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.cnLatest Articles by Author
2024-10-22 09:46:29 2024-10-13 13:53:41 2024-10-12 12:15:51 2024-10-11 22:47:31 2024-10-11 19:36:51 2024-10-11 15:50:41 2024-10-11 15:07:41 2024-10-11 14:21:21 2024-10-11 12:59:11 2024-10-11 12:17:31Latest IssuesHow to display the mobile version of Google Chrome Hello teacher, how can I change Google Chrome into a mobile version?From 2024-04-23 00:22:190112186There is no output in the parent window document.onclick = function(){ window.opener.document.write('I am the output of the child ...From 2024-04-18 23:52:34011733Related TopicsMore>Popular RecommendationsPopular TutorialsMore>
JAVA Beginner's Video Tutorial2513849 Latest DownloadsMore>