HTML标题<h>,HTML H标题标签

可以将HTML标题或HTML h标签定义为要在网页上显示的标题或副标题。当你将文本放在标题标签

……… h1>内时, 它在浏览器中以粗体显示, 并且文本的大小取决于标题的数量。

标签定义了六个不同的HTML标题, 从最高级别h1(主标题)到最低级别h6(最重要的标题)。

h1是最大的标题标签, h6是最小的标题标签。因此, h1用于最重要的标题, h6用于最不重要的标题。

HTML中的标题可帮助搜索引擎理解网页并为其编制索引。

注意:网页整个内容的主要关键字应通过h1标题标签显示。

请参阅以下示例:

Heading no. 1

Heading no. 2

Heading no. 3

Heading no. 4
Heading no. 5
Heading no. 6

立即测试

输出:

Heading no. 1

Heading no. 2

Heading no. 3

Heading no. 4

Heading no. 5

Heading no. 6

标题元素(h1 …. h6)仅应用于标题。它们不应仅用于使文本加粗或变大。

HTML标题也可以与嵌套元素一起使用。以下是显示标题元素使用方式的不同代码。

例:

Heading elements

This is main heading of page.

h1 is the most important heading, which is used to display the keyword of page

This is first sub-heading

h2 describes the first sub heading of page.

This is Second sub-heading

h3 describes the second sub heading of page.

We can use h1 to h6 tag to use the different sub-heading with their paragraphs if

required.

输出:

html-heading.png

支持的浏览器

Element

Chrome

IE

Firefox

Opera

Safari

Yes

Yes

Yes

Yes

Yes

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值