figure & figcaption 、details & summary 、 mark

本文详细介绍了HTML中的<figure>、<figcaption>、<details>和<summary>等标签的使用方法及应用场景,并对比了<figure>与<aside>的区别。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

HTML <figure> Tag & <figcaption> Tap

Use a <figure> element to mark up a photo in a document:


Use a <figure> element to mark up a photo in a document. The <figure> element also contains a caption:


Definition and Usage 

The <figure> tag specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.
While the content of the <figure> element is related to the main flow, its position is independent of the main flow, and if removed  it should not affect the flow of the document. A figure element is only allows one figcapiton.
The <figcaption> tap defines a caption for a <figure> element.
The <figcaption> element can be placed as the first or last child of the <figure> element.

Differences between <figure> and <aside>
*If the contents is simply related and not essential, use <aside>
*If the contents is essential but its position in the flow of content isn't important, use <figure>

HTML <details> Tag & <summary> Tap
Using the <details> element & <summary> element


Definition and Usage 

The <detail> tag specifies details that the user can view or hide on demand.
The <detail> tag can be used to create an interactive widget that the user can open and close.Any sort of content can be put inside the <details> tag.
The content of a <details> element should not be visible unless the open attribute is set.
HTML <mark> Tag
Highlight parts of a text: 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值