Figures and Captions
The <figure> and <figcaption> elements group self-contained content with an optional caption, perfect for images, diagrams, code snippets, and more.
Basic Figure Usage
Loading HTML Playground...
The <figure> element:
- Groups content that's referenced from main content
- Can be moved without affecting document flow
<figcaption>provides a caption
Figure vs Regular Image
Loading HTML Playground...
Use <figure> when:
- Content is referenced from text
- Content could be moved to appendix
- You need a visible caption
Caption Placement
Loading HTML Playground...
The <figcaption> can appear:
- Before or after the figure content
- Only one figcaption per figure
Multiple Images in One Figure
Loading HTML Playground...
A single figure can contain multiple related images.
Figure for Code Snippets
Loading HTML Playground...
Figures work for any self-contained content:
- Code examples
- Diagrams
- Equations
- Poems
Figure for Quotes
Loading HTML Playground...
Styling Figures
Loading HTML Playground...
Exercise: Create an Image Gallery
Create a gallery using figures with captions:
Loading HTML Exercise...
Figures provide semantic structure for self-contained content with captions!
التالي · الدرس 13 من 32
Audio and Video
قراءة 2 دقيقة
أنهيت 12 من 32 درسًا

اسأل Byte عن هذا الدرس
محادثة خاصة حول هذا الدرس. قرأ Byte الدرس كاملًا، ويجيب خلال ثوانٍ، ويُظهر القسم الذي تأتي منه كل إجابة. يمكنك السؤال بأي لغة.
الأسئلة والأجوبة
أسئلة عامة حول هذا الدرس. يجيب AI Tutor فورًا بلغتك، ويراجع فريق FreeAcademy الإجابات، ويمكن لكل المتعلمين قراءتها.

