The WebPlatform project has been discontinued when the Stewards partnership agreement ended in September 2015. This site has been frozen, and the assets we have created will remain.


< html‎ | elements
Jump to: navigation, search


This article is Almost Ready.

W3C Recommendation


The figure element (<figure>) represents self-contained content (such as an image), optionally with a caption, that can be referenced as a single unit from the main content of the document.

Overview Table

DOM Interface HTMLElement

A figure can be given a caption with the figcaption element.


This example shows the figure element to mark up a code listing. The figcaption element represents the caption of the figure. The author has also provided a link to the figure in the main content by using a named anchor.

<!-- Main Content -->
<p>In <a href="#l4">listing 4</a> we see the primary core interface API declaration.</p>
<!-- Figure Content -->
<figure id="l4">
    <figcaption>Listing 4. The primary core interface API declaration.</figcaption>
    <pre><code>interface PrimaryCore {
 boolean verifyDataLine();
 void sendData(in sequence&lt;byte> data);
 void initSelfDestruct();



The figure element can be used to annotate content that can be referenced from the main content of the document, such as illustrations, diagrams, photos, code listings, and so on. Figures can be moved away from primary content without affecting the flow of the document. You can jump to the figure from the main content by using a named anchor. The id attribute of the figure element specifies the fragment identifier (name of the anchor). The default CSS for the figure element is as follows.

margin: 1em 40px

The figure element, like aside, separates content from the main flow. Use the aside element when the content is simply related, but not essential. Use figure if the content is essential, but position is not important. Windows Internet Explorer 9. The figure element is only supported for webpages displayed in IE9 Standards mode. For more information, see Defining Document Compatibility.

Related specifications

Specification Status Related Changes
HTML 5.1 W3C Working Draft
HTML 5 W3C Recommendation

See also

Other articles


This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]