Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

html
figcaption
communitycreator

What is the <figcaption> tag in HTML?

Shubham Singh Kshatriya

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Overview

In HTML, the <figcaption> tag is used to define the caption of the <figure> element. It is added as the last or the first child of the <figure> element in a document.

Syntax

<figure>
  <img src="...">
  <figcaption></figcaption>
</figure>

// or

<figure>
  <figcaption></figcaption>
  <img src="...">
</figure>

Attribute support

The <figcaption> tag supports both the global and the event attributes that can be used in HTML elements.

Browser support

The <figcaption> tag supports the following browsers:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

Code example

Let’s see an example of the <figcaption> tag in the following code widget:

Code explanation

In the HTML tab:

  • In line 6, we create a <figure> element and add an image inside, it using the <img> tag.
  • In line 8, we define the caption of the <figure> element, using the <figcaption> tag.

Output

In the output, we see the Educative logo and a caption beneath it, which was added with the help of the <figcaption> tag.

RELATED TAGS

html
figcaption
communitycreator

CONTRIBUTOR

Shubham Singh Kshatriya

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring