In this article I am going to describe Figure and Figcaption tags of HTML5. Both of these tags are new.
Figure Tag
The Figure tag is used to show flow content. The flow content is the elements that are used in the body tag.
Figcaption Tag
The Figcaption tag represents caption of elements. Figcaption is optional and it can appear before or after the Figure Tag.
Syntax
The syntax of the Figure and Figcaption tags in HTML5 are:
<figure> flow controls</figure>
<figcaption> caption</figcaption>
So, let's begin it now.
Step 1
The complete code of figure.html is:
- <DOCTYPE html>
- <html>
- <head>
- <title>Figure and Figcaption tags</title>
- </head>
- <body>
- <div>
- <h1 >Implementation Of Figure and Figcaption tag in html5</h1>
- <figure>
- <img src="/C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg" alt="Picture" width="300" height="400"/>
- <figcaption>This picture represent a Desert image</figcaption>
- </figure>
- </div>
- </body>
- </html>
Step 2
Output of Figure and Figcaption tag is as below: