Table of Contents
The most commonly used HTML5 tags and attributes
Basic HTML tags
HTML text formatting tag
HTML "Computer output" tag
HTML Citation, Reference and Definition Tags
HTML CSS Style
HTML Table Tag
HTML List
HTML Grouping Tag
HTML Iframe tag
Home Web Front-end Front-end Q&A What are the html5 tags?

What are the html5 tags?

Jun 09, 2021 am 10:35 AM
html5 Label

html5 tags include: p, a, img, map, area, html, body, br, b, big, em, i, small, strong, sub, sup, ins, del, code, samp, kbd, tt, var, pre, address, bdo, q, etc.

What are the html5 tags?

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

The most commonly used HTML5 tags and attributes

Basic HTML tags

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

<h1> - <h6> 标签定义 HTML 标题

<p> 标签定义 HTML 段落

<a> 标签定义 HTML 链接

   超链接:

   >通过使用 href 属性 - 创建指向另一个文档的链接

   >通过使用 name 属性 - 创建文档内的书签

   >通过使用 Target 属性,你可以定义被链接的文档在何处显示

   >语法:<a href="url">Link text</a>

   锚点:

   >语法:<a name="label">锚(显示在页面上的文本)</a>

<img  src="/static/imghw/default1.png"  data-src="demo_iframe.htm"  class="lazy"  alt="What are the html5 tags?" > 标签定义 HTML 图像

<map> 定义图像地图

<area>    定义图像地图中的可点击区域

<html>    定义 HTML 文档

<body>    定义文档的主体

<hr /> 标签创建 HTML 页面水平线

 <!-- --> HTML 注释

<br />    插入单个折行(换行)

Copy after login

HTML text formatting tag

1

2

3

4

5

6

7

8

9

10

<b> 定义粗体文本

<big> 定义大号字

<em> 定义着重文字

<i> 定义斜体字

<small> 定义小号字

<strong> 定义加重语气

<sub> 定义下标字

<sup> 定义上标字

<ins> 定义插入字

<del> 定义删除字

Copy after login

HTML "Computer output" tag

1

2

3

4

5

6

<code> 定义计算机代码

<kbd> 定义键盘码

<samp> 定义计算机代码样本

<tt> 定义打字机代码

<var> 定义变量

<pre class="brush:php;toolbar:false"> 定义预格式文本

Copy after login

HTML Citation, Reference and Definition Tags

1

2

3

4

5

6

7

<abbr>    定义缩写或首字母缩略语

<address> 定义文档作者或拥有者的联系信息

<bdo> 定义文本方向

<blockquote>  定义从其他来源引用的节

<dfn> 定义项目或缩略词的定义

<q>   定义短的行内引用

<cite>    定义著作的标题

Copy after login

HTML CSS Style

1

2

3

4

5

6

<style>   定义样式定义

<link>    定义资源引用

<p>   定义文档中的节或区域(块级)

<span>    定义文档中的行内的小块或区域

<font>    规定文本的字体、字体尺寸、字体颜色。不赞成使用。请使用样式

<center>  对文本进行水平居中。不赞成使用。请使用样式

Copy after login

HTML Table Tag

1

2

3

4

5

6

7

8

9

10

<table> 定义表格

<caption> 定义表格标题

<th>  定义表格的表头

<tr>  定义表格的行

<td>  定义表格单元

<thead>   定义表格的页眉

<tbody>   定义表格的主体

<tfoot>   定义表格的页脚

<col> 定义用于表格列的属性

<colgroup>    定义表格列的组

Copy after login

HTML List

1

2

3

4

5

6

<ol>  定义有序列表

<ul>  定义无序列表

<li>  定义列表项

<dl>  定义定义列表

<dt>  定义定义项目

<dd>  定义定义的描述

Copy after login

HTML Grouping Tag

1

2

<p>   定义文档中的分区或节(pision/section)。

<span>    定义 span,用来组合文档中的行内元素。

Copy after login

HTML Iframe tag

URL points to the location of the quarantine page.

(2) The height and width attributes are used to specify the height and width of the iframe. The default unit for attribute values ​​is pixels, but they can also be set in percentages (such as "80%").

Example:

(3) Delete the border

# The ##frameborder attribute specifies whether to display the border around the iframe. Set the property value to "0" to remove the border. Example:

(4) Use iframe as the target of the link

iframe can be used as a link target. The link's target attribute must reference the iframe's name attribute. Example:

HTML header element

1

2

3

4

5

6

7

<head>    定义关于文档的信息

<title>   定义文档标题

<base>    定义页面上所有链接的默认地址或默认目标

<link>    定义文档与外部资源之间的关系

<meta>    定义关于 HTML 文档的元数据

<script>  定义客户端脚本

<style>   定义文档的样式信息

Copy after login

Useful character entities in HTML

Note: Entity names are case-sensitiveWhat are the html5 tags?

HTML form

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

<input> 元素有很多形态,根据不同的 type 属性。

(1)text 定义常规文本输入。

<input type="text"> 定义用于文本输入的单行输入字段。

(2)radio    定义单选按钮输入(选择多个选择之一)。

<input type="radio"> 定义单选按钮。

(3)submit   定义提交按钮(提交表单)。

<input type="submit"> 定义用于向表单处理程序(form-handler)提交表单的按钮。

(4)action 属性定义在提交表单时执行的动作。向服务器提交表单的通常做法是使用提交按钮。通常,表单会被提交到 web 服务器上的网页。

<form action="action_page.php"> 如果省略 action 属性,则 action 会被设置为当前页面。

(5)button属性定义按钮。<input type="button>

(6)method 属性规定在提交表单时所用的 HTTP 方法(GET 或 POST):

<form action="action_page.php" method="GET">或:<form action="action_page.php" method="POST">

(7)name规定识别表单的名称(对于 DOM 使用:document.forms.name)。

(8)用 <fieldset> 组合表单数据:<fieldset> 元素组合表单中的相关数据,<legend> 元素为 <fieldset> 元素定义标题。

(9)novalidate 规定浏览器不验证表单。

(10)target规定 action 属性中地址的目标(默认:_self)。

(11)date用于应该包含日期的输入字段<input type="date"> 。month允许用户选择月份和年份<input type="month"> 。week允许用户选择周和年<input type="week"> 。time允许用户选择时间(无时区)<input type="time"> 。datetime允许用户选择日期和时间(有时区)<input type="datetime"> 。datetime-local允许用户选择日期和时间(无时区)<input type="datetime-local"> 。color用于应该包含颜色的输入字段<input type="color"> 。range用于应该包含一定范围内的值的输入字段<input type="range"> 。根据浏览器支持,日期选择器会出现输入字段中。

(12)search 用于搜索字段(搜索字段的表现类似常规文本字段)<input type="search">。tel用于应该包含电话号码的输入字段<input type="tel"> 。url 用于应该包含 URL 地址的输入字段<input type="url">。

Copy after login

HTML Input attribute

  • value attribute: Specifies the input field initial value.

  • readonly attribute: Specifies that the input field is read-only (cannot be modified). The readonly attribute does not require a value. It is equivalent to readonly="readonly".

  • disabled attribute: Specifies that the input field is disabled, disabled elements are unavailable and non-clickable, and disabled elements will not be submitted. The disabled attribute requires no value. It is equivalent to disabled="disabled".

  • size attribute: Specifies the size of the input field (in characters).

  • maxlength attribute: Specifies the maximum length allowed for the input field.

  • autocomplete attribute: Specifies whether the form or input field should be automatically completed. When autocomplete is turned on, the browser automatically fills in values ​​based on what the user has previously entered.

  • The novalidate attribute belongs to the < form> attribute. If set, novalidate specifies that form data will not be validated when the form is submitted.

  • The autofocus property is a Boolean property. If set, specifies that the < input> element should automatically gain focus when the page loads.

  • The form attribute specifies one or more forms to which the element belongs. To reference more than one form, use a space-separated list of form ids.

  • The ormaction attribute specifies the URL of the file that handles the input control when the form is submitted. The formaction attribute overrides the action attribute of the < form> element. The formaction attribute works with type="submit" and type="image".

  • The formenctype attribute specifies how form-data is encoded when it is submitted to the server (only for forms with method="post"). The formenctype attribute overrides the enctype attribute of the < form> element. The formatctype attribute applies to type="submit" and type="image".

  • The formmethod attribute defines the HTTP method used to send form-data to the action URL. The formmethod attribute overrides the method attribute of the < form> element. The formmethod attribute works with type="submit" and type="image".

  • The novalidate property is a Boolean property. If set, specifies that elements will not be validated when the form is submitted. The formnovalidate attribute overrides the novalidate attribute of the < form> element. The formnovalidate attribute is available with type="submit".

  • The name or keyword specified by the formtarget attribute indicates where to display the received response after the form is submitted. The formtarget attribute overrides the target attribute of the < form> element. The formtarget attribute can be used with type="submit" and type="image".

  • The height and width attributes specify the height and width of the < input> element. The height and width attributes are only used for < input type="image">.

  • list 属性引用的 < datalist> 元素中包含了 < input> 元素的预定义选项。

  • min 和 max 属性规定 元素的最小值和最大值。min 和 max 属性适用于如需输入类型:number、range、date、datetime、datetime-local、month、time 以及 week。

  • multiple 属性是布尔属性。如果设置,则规定允许用户在 < input> 元素中输入一个以上的值。multiple 属性适用于以下输入类型:email 和 file。

  • pattern 属性规定用于检查 < input> 元素值的正则表达式。pattern 属性适用于以下输入类型:text、search、url、tel、email、and password。

  • placeholder 属性规定用以描述输入字段预期值的提示(样本值或有关格式的简短描述)。该提示会在用户输入值之前显示在输入字段中。placeholder 属性适用于以下输入类型:text、search、url、tel、email 以及 password。

  • required 属性是布尔属性。如果设置,则规定在提交表单之前必须填写输入字段。required 属性适用于以下输入类型:text、search、url、tel、email、password、date pickers、number、checkbox、radio、and file。

  • step 属性规定 元素的合法数字间隔。示例:如果 step=“3”,则合法数字应该是 -3、0、3、6、等等。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

<article> 定义文档内的文章。

<aside>   定义页面内容之外的内容。

<bdi> 定义与其他文本不同的文本方向。

<details> 定义用户可查看或隐藏的额外细节。

<dialog>  定义对话框或窗口。

<figcaption>  定义 <figure> 元素的标题。

<figure>  定义自包含内容,比如图示、图表、照片、代码清单等等。

<footer>  定义文档或节的页脚。

<header>  定义文档或节的页眉。

<main>    定义文档的主内容。

<mark>    定义重要或强调的内容。

<menuitem>    定义用户能够从弹出菜单调用的命令/菜单项目。

<meter>   定义已知范围(尺度)内的标量测量。

<nav> 定义文档内的导航链接。

<progress>    定义任务进度。

<rp>  定义在不支持 ruby 注释的浏览器中显示什么。

<rt>  定义关于字符的解释/发音(用于东亚字体)。

<ruby>    定义 ruby 注释(用于东亚字体)。

<section> 定义文档中的节。

<summary> 定义 <details> 元素的可见标题。

<time>    定义日期/时间。

<wbr> 定义可能的折行(line-break)。

<canvas>  定义使用 JavaScript 的图像绘制。

<svg> 定义使用 SVG 的图像绘制。

<audio>   定义声音或音乐内容。

<embed>   定义外部应用程序的容器(比如插件)。

<source>  定义 <video> 和 <audio> 的来源。

<track>   定义 <video> 和 <audio> 的轨道。

<video>   定义视频或影片内容。

Copy after login

推荐学习:html视频教程

The above is the detailed content of What are the html5 tags?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles