← 返回首页
<figcaption> - HTML: Lenguaje de etiquetas de hipertexto | MDN

Esta página ha sido traducida del inglés por la comunidad. Aprende más y únete a la comunidad de MDN Web Docs.

View in English Always switch to English

<figcaption>

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since julio de 2015.

El elemento HTML <figcaption> representa un subtítulo o leyenda asociado al contenido del elemento padre <figure>, pudiendo ser colocado como primer o último hijo. Es importante destacar que el elemento <figcaption> es opcional.

In this article

Pruébalo

<figure> <img src="/shared-assets/images/examples/elephant.jpg" alt="Elephant at sunset" /> <figcaption>An elephant at sunset</figcaption> </figure>
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; }
Content categories Contenido Permitido Omisión de etiqueta Elementos padre permitidos Interfaz DOM Contento en el que puede ser usado
Ninguna
Flow content.
Ninguna, tanto la etiqueta inicial como la final son obligatorias.
En un elemento <figure> el elemento <figcaption> debe ser el primero o el último hijo.
HTMLElement
Como the first o last child de un <figure> element

Atributos

Este elemento sólo incluye los global attributes.

Ejemplos

Para ejemplos con <figcaption>, por favor ver la página <figure>.

Especificaciones

Specification
HTML
# the-figcaption-element

Compatibilidad con navegadores

Enable JavaScript to view this browser compatibility table.

Ver además