Home >Web Front-end >Front-end Q&A >Is figure a new tag in html5?

Is figure a new tag in html5?

青灯夜游
青灯夜游Original
2022-05-18 16:21:352565browse

figure is a new tag. Figure is a new semantic tag in HTML5, which is used to specify independent flow content, such as images, charts, photos, etc.; the content in figure is usually related to the main content, and the position of the element is independent from the main content. Yes, if you delete it, it will not affect other content in the web page.

Is figure a new tag in html5?

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

is a new tag in HTML 5, a new semantic tag added to html5.

is used to specify independent stream content (images, charts, photos, code, etc.).

The content in the figure is usually related to the main content, and the position of the elements is independent from the main content. If it is deleted, it should not affect the document flow; that is, if the figure is deleted, it will not affect other content in the web page.

Note:

  • The outline of the element content is excluded from the main outline of the document.

  • The

    element can be used with the
    element.

    The

    element is used to define the title for the
    element.

    Insert a

    into the
    element to associate a title with it (as its first or last child element)

Benefits of using figure and figcaption tags

When search engines search for figure, they will know that pictures, charts, photos, codes and other media are stored here. I don’t think that what is stored here is articles or other things. Search engines make searching faster and more convenient.

On the other hand, when programmers see this label, they will know that what exists here are pictures and other media for easy reading.

Is figure a new tag in html5?

Example:

<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>figure和 figcaption元素的使用</title>
	</head>
	<body>
		<p>被称作“第四代体育馆”的“鸟巢”国家体育场是 2008年北京奥运会的标志性建筑,它位于北京北四环边,包含在奥林匹克国家森林公园之中。占地面积 20.4万平方米,总建筑面积 25.8万平方米,拥有
			9.1万个固定座位,内设餐厅、运动员休息室、更衣室等。2008年奥运会期间,承担开幕式、闭幕式、田径比赛、男子足球决赛等赛事活动。</p>
		<figure>
			  <figcaption>北京鸟巢</figcaption>
			  <p>拍摄者:XXXX,拍摄时间:2020 年 09 月</p>
			  <img src="Is figure a new tag in html5?" alt="">
			 </figure>
	</body>

</html>

Is figure a new tag in html5?

(Learning video sharing: html video tutorial web front end

The above is the detailed content of Is figure a new tag in html5?. For more information, please follow other related articles on the PHP Chinese website!

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