HTML5 figure example, Define figure and figcapation tag.


 

HTML5 figure example, Define figure and figcapation tag.

In this section, you will see the use of figure and figcapation tag of HTML5.

In this section, you will see the use of figure and figcapation tag of HTML5.

HTML5 figure example, Define figure and figcapation tag.

In this section, you will see the use of figure and figcapation tag of HTML5. Both are new. The figure tag is used to show flow content and figcaption tag represent caption of element. The flow content are elements, that are used in body tag. You can remove figure tag. It can not affect document actual meaning. It works as a single unit. the figcaption is an optional.

Declaration Syntax :

Declaration syntax of figure  and  figcapation in HTML5.

         <figure  >
                    flow controls</figure  >
                   <figcaption>
                                caption</figcaption>                         

Example of <figure > in HTML5:

Code:
figureTag.html
<!DOCTYPE html >
<html >
<head>
<title>Figure tag og HTML5.</title>
</head>
<body>
<h1>Implementation of figure and figcapation tag.</h1>
<figure>
<img src="comp.gif">
<figcaption>This picture represents a computer image.</figcaption>
</figure>
</body>
</html>
Output:

Download this code

Difference Between HTML5 and HTML4.01:

The fieldset tag is available in both HTML5 and HTML4.01. But there is some attribute in HTML5, that is not supported by HTML4.01.

Ads