In this article we will learn about some of the frequently asked HTML programming questions in technical like “
how to use figure and caption in html
xxxxxxxxxx
1
<!-- Just an image -->
2
<figure>
3
<img
4
src="https://developer.mozilla.org/static/img/favicon144.png"
5
alt="The beautiful MDN logo.">
6
</figure>
7
8
<!-- Image with a caption -->
9
<figure>
10
<img
11
src="https://developer.mozilla.org/static/img/favicon144.png"
12
alt="The beautiful MDN logo.">
13
<figcaption>MDN Logo</figcaption>
14
</figure>
15
html figure
xxxxxxxxxx
1
<figure>
2
<img src="image-url.com or local-filename.jpg" width="auto" height="auto" alt="figure alt text">
3
<figcaption>
4
Figure caption <!-- can also use <div>, <p>, etc. tags within <figcaption> -->
5
</figcaption>
6
</figure>
html
xxxxxxxxxx
1
<figure>
2
<img src="/media/examples/elephant-660-480.jpg"
3
alt="Elephant at sunset">
4
<figcaption>An elephant at sunset</figcaption>
5
</figure>