This topic has not yet been rated - Rate this topic

figure element | figure object

[This documentation is preliminary and is subject to change.]

Represents self-contained content, optionally with a caption, that can be referenced as a single unit from the main content of the document.

Internet Explorer 9

Standards information

There are no standards that apply here.

HTML information

Closing Tagrequired
CSS Displayblock

DOM Information

Inheritance Hierarchy

 Node
    figure
 Element
    figure

Remarks

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.

Examples

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();
}</code></pre>
</figure>


See also

Reference
article
aside
figcaption
footer
header
hgroup
mark
nav
section

 

 

Build date: 3/8/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ