pub struct Figcaption;Expand description
The <figcaption> element - figure caption.
§Purpose
The <figcaption> element represents a caption or legend for the content of its
parent <figure> element. It provides a description or title for the figure.
§Content Categories
- None (only valid as child of
<figure>)
§Permitted Content Model
- Flow content
§Common Use Cases
- Image captions
- Code example descriptions
- Chart or diagram titles
- Table or figure numbering and titles
§Key Attributes
- Global attributes only
§Example
<figure>
<img src="mountain.jpg" alt="Mountain landscape">
<figcaption>
<strong>Figure 2.1:</strong> The Rocky Mountains at sunset.
Photo by Jane Photographer.
</figcaption>
</figure>
<figure>
<table>
<tr><th>Year</th><th>Sales</th></tr>
<tr><td>2023</td><td>$1.2M</td></tr>
</table>
<figcaption>Table 1: Annual sales figures</figcaption>
</figure>§WHATWG Specification
Trait Implementations§
Source§impl HtmlElement for Figcaption
impl HtmlElement for Figcaption
impl<T: FlowContent> CanContain<T> for Figcaption
impl CanContain<Text> for Figcaption
Auto Trait Implementations§
impl Freeze for Figcaption
impl RefUnwindSafe for Figcaption
impl Send for Figcaption
impl Sync for Figcaption
impl Unpin for Figcaption
impl UnwindSafe for Figcaption
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more