figure ... ⁄figure
HTML5 figure element
The figure element allows you to mark up an independent unit of flow content, (from the main flow of the document), to which you can add a caption ⁄ legend through figcaption element. »video
About figure
- is an optional element
- multiple figure elements allowed per HTML5 document
Display & support figure
- display in browser »video
- display type: block





Parents, children figure
- figure nested within elements »figure parents
- elements nested within figure »figure children
»examples
Attributes figure
- required: none
- optional: global attributes, event attributes
Examples
- 1 complex example: »video
- 3 images + their caption: each marked up with figure element;
- then this group of 3 images + a hyperlink nested inside another figure element whose caption is composed by: an image followed by text and a hyperlink on the next line - 3 simple examples: »video
- a block quotation with its caption: nested inside
- a verse with its caption: nested inside
- a fragment of php code with caption: nested inside
Syntax figure
1 | <> ... </> »video |
Attributes and Values figure (comma separated)
< | attribute | = | "attribute_value(s)" | > | Video | Examples |
---|---|---|---|---|---|---|
1. specific attributes | ||||||
All Specific Attributes | ||||||
2. global attributes | ||||||
1. | accesskey | = | keyboard key | »img | <accesskey="h"> ... </ > | |
2. | class | = | class name | »html »img | <class="class_name"> ... </ > | |
3. | contenteditable | = | "", , true, false | »html | <contenteditable="true"> ... </ > | |
4. | contextmenu | = | menu id value | »html | <contextmenu="menu_id_value"> ... </ > | |
5. | data-* | = | value | - | <data-http-error="404"> ... </ > | |
6. | dir | = | ltr, rtl, auto | »html | <dir="ltr"> ... </ > | |
7. | draggable | = | true, , false | »img | <draggable="false"> ... </ > | |
8. | dropzone | = | copy, move, link, string:, file: | - | <dropzone="copy"> ... </ > | |
9. | hidden | = | "", , hidden | »html »img | <hidden="hidden"> ... </ > | |
10. | id | = | id name | »html »img | <id="unique_id_name"> ... </ > | |
11. | itemid | = | URL | - | - | |
12. | itemprop | = | string | »link »a | - | |
13. | itemref | = | string | - | - | |
14. | itemscope | = | "", , itemscope | - | - | |
15. | itemtype | = | absolute URL | - | - | |
16. | lang | = | language code | »html »head»title »img | <lang="en"> ... </ > | |
17. | spellcheck | = | "", , true, false | »html | <spellcheck="true"> ... </ > | |
18. | style | = | CSS property:value | »html »img | <style="color:red"> ... </ > | |
19. | tabindex | = | integer | »img | <tabindex="3"> ... </ > | |
20. | title | = | text | »html »link»style »abbr»dfn »img »meter | <title="html page"> ... </ > | |
21. | translate | = | "", yes, no | »html »img | <translate="yes"> ... </ > | |
All Global Attributes | ||||||
3. global event attributes | ||||||
1. | onclick | = | script | » list | <element onclick="script" > ... | |
2. | ondblclick | = | script | » list | <element ondblclick="script" > ... | |
All Event Attributes |
Video demonstration figure element
HTML5 figure: mark up a self-contained unit of flow content
min | video details |
---|---|
00:00 | video tutorial: figure element |
00:06 | figure element allows you to mark up a self-contained unit of flow content from the main flow of the document |
00:11 | figcaption element allows you to mark up the caption ⁄legend for the rest of the content of a figure element |
00:23 | 3 cases: |
00:23 | case 1 : - figure element without figcaption element (figcaption is optional) - flow content nested inside |
00:24 | flow content inside |
00:26 | case 2 : - figure element with figcaption element (figcaption is the 1st child); - flow content nested inside figure AFTER figcaption |
00:26 | flow content after figcaption |
00:29 | case 3 : - figure element with figcaption element (figcaption is the last child); - flow content nested inside figure BEFORE figcaption |
00:31 | flow content before figcaption |
00:52 | example 1: the video and its caption can represent a unit of self-contained flow content (independent flow content) case3: figcaption preceded by flow content, where the figcaption gives the caption of the flow content: figcaption: Avatar - Official Trailer flow content: iframe element (the video will be embedded in page within a nested browsing context: iframe) |
01:19 | a video and its caption, suitable content for figure element |
01:26 | the figcaption element is optional |
01:30 | no caption |
01:44 | example2: this table and its caption can represent a unit of self-contained flow content (independent flow content suitable for figure element) case2: figcaption followed by flow content, where the figcaption gives the caption of the flow content figcaption: Box Office flow content: table element |
03:06 | a table + its caption, a unit of independent flow content, suitable for the figure element ( = it means that it can be marked up with figure element) |
03:14 | example3: (let's consider only a part of thus content) an ordered list and its caption can represent a unit of self-contained flow content (independent flow content suitable for figure element) case2: figcaption followed by flow content, where the figcaption gives the caption of the flow content: figcaption: Box Office flow content: ol element |
03:47 | an ordered list + its caption, a unit of independent flow content, suitable for the figure element |
03:58 | example4: an image (photo, illustration..) and its caption ⁄legend can represent a unit of self-contained flow content (independent flow content suitable for figure element) case3: figcaption preceded by flow content, where the figcaption gives the caption of the flow content: figcaption: Rosario Dawson (34) flow content: img element |
04:34 | an image + its caption, a unit of independent flow content, suitable for the figure element |