HTML <figure>
query_builder | Christopher PisaniThe HTML element <figure> represents the content within it, and uses the element <figcaption> to display a caption for information.
<style>
figure {
border: thin #c0c0c0 solid;
display: flex;
flex-flow: column;
padding: 5px;
max-width: 220px;
margin: auto;
}
img {
max-width: 220px;
max-height: 150px;
}
figcaption {
background-color: #222;
color: #fff;
font: italic smaller sans-serif;
padding: 3px;
text-align: center;
}
</style>
<figure>
<img src="https://interactive-examples.mdn.mozilla.net/media/examples/elephant-660-480.jpg"
alt="Elephant at sunset">
<figcaption>An elephant at sunset</figcaption>
</figure>
Available Attributes
No specific attributes are assigned for this element, other than the standard global attributes.