The igure element is a combination of elements that can have a caption (optional). A figure tag is used to represent a piece of separate content on a Web page that is removed from the page without affecting other content on the page. A figure can represent a picture, a chart, or a code sample.
Figure UF a sub-label--figcaption label.
Note: only one figcaption element is allowed in a figure element, and the other elements can be placed indefinitely.
Case 1:
Figure element with no caption:
- <! DOCTYPE html>
- <meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
- <TITLE>HTML5 daily Practice Figure the application of a new tag-figure element with no caption </title>
- <body>
- <figure>
- </figure>
- </body>
Copy Code
Case 2:
Figure element with caption:
- <! DOCTYPE html>
- <meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
- <TITLE>HTML5 daily Practice Figure the application of a new tag-a figure element with a caption </title>
- <body>
- <figure>
- <figcaption>W3Cfuns</figcaption>
- </figure>
- </body>
Copy Code
Case 3:
Multiple pictures, a figure element of the same caption:
- <! DOCTYPE html>
- <meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
- <TITLE>HTML5 daily Practice Figure the application of a new label-multiple pictures, the same title of the figures element </title>
- <body>
- <figure>
- <figcaption>w3cfuns build the authoritative community for Web front-end development! </figcaption>
- </figure>
- </body>
Copy Code