Home >Web Front-end >HTML Tutorial >A brief discussion of html semantic tags, Html5 new semantic tags_html/css_WEB-ITnose

A brief discussion of html semantic tags, Html5 new semantic tags_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:49:401298browse

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

1):3499910bf9dac5ae3c52d5ede7383485 Tag: Implement hyperlink

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):e388a4556c0f65e1904146cc1a846bee tag: Article paragraphs are placed in the e388a4556c0f65e1904146cc1a846bee tags

3): 4fc71829d7d7f105985af72054fc4928 tag: article title, column title is represented by 4fc71829d7d7f105985af72054fc4928

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. 4a249f0d628e2318394fd9b75b4636b1 is the highest level.

4): 8e99a69fbe029cd4e2b854e244eab143 and 907fae80ddef53131f3292ee4f81644b tags: emphasize certain words

but both There is a difference in the tone of emphasis: 907fae80ddef53131f3292ee4f81644b means emphasis, 8e99a69fbe029cd4e2b854e244eab143 means stronger emphasis. And in the browser, 907fae80ddef53131f3292ee4f81644b is represented by italic by default, and 8e99a69fbe029cd4e2b854e244eab143 is represented by bold.

Compared with the two tags, domestic front-end programmers currently prefer to use 8e99a69fbe029cd4e2b854e244eab143 to express emphasis.

5):1244aa79a84dea840d8e55c52dc97869 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):b8a712a75cab9a5aded02f74998372b4 tag: long text quote

Note that the browser does not accept 86418835f6a5021dc9ffbed4da1da974 The parsing of the tag is indentation style

7):208700f394e4cf40a7aa505373e0130b tag: add address information to the web page

8):ff6d136ddc5fdfeffaf53ff6ee95f185Tag: unordered list

9):c34106e0b4e09414b63b2ea253ff83d6Tag: ordered list

10 ):63bd76834ec05ac1f4c0ebbeaafb0994 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: fc5289d1a8ae23fdb076564106473cf3

The title is used to describe the content of the table. The title is displayed at the top of the table.

Syntax: 63bd76834ec05ac1f4c0ebbeaafb0994title text37eb775bb5a9e6f3d094e96a76117fe8

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>

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>

3): 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>

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> &copy; 2012 Baidu 使用百度前必读 京ICP证030173号 </footer>

 

7):nav 标签:导航链接放在nav标签里。

nav标签里应该放入一些当前页面的主要导航链接。

例如在页脚显示一个站点的导航链接(如首页,服务信息页面,版权信息页面等等),就可以使用nav标签,当然,这不是必须的。

 

8):time 标签:定义公历的时间(24 小时制)或日期,时间和时区偏移是可选的。

该元素能够以机器可读的方式对日期和时间进行编码,搜索引擎也能够生成更智能的搜索结果

 

9):mark 标签:定义带有记号的文本。请在需要突出显示文本时使用 f920514e6447cf1d171079d1371f007f 标签。

 

10):figure标签:规定独立的流内容(图像、图表、照片、代码等等)。

figure 元素的内容应该与主内容相关,但如果被删除,则不应对文档流产生影响。

 

11):figcaption 标签:定义 figure 元素的标题(caption)。

"figcaption" 元素应该被置于 "figure" 元素的第一个或最后一个子元素的位置。

实例:

<figure> <figcaption>美女图片</figcaption> <img src="meizi.jpg" width="350" height="234" /></figure>

 

Statement:
The 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