The HTML summary element (<summary>) is used as a summary, caption, or legend for the content of a <details> (en-US) element.

備註: If the <summary> element is omitted, the heading "details" will be used.

備註: The default style for <summary> is display:list-item per HTML standard. If the style is being changed to display:block, the disclosure triangle will be dismissed, which is expected. See Bug 1283989 for more information.

Usage context

Permitted content Phrasing content or one element of Heading content
Tag omission None, both the start tag and the end tag are mandatory.
Permitted parent element The <details> (en-US) element.
Normative document HTML5, section 4.11.2


This element only includes the global attributes (en-US).

DOM interface

This element implements the HTMLElement interface.


<details style="color: blue; margin-left: 15px; margin-bottom: 10px;">
  <p>In summation, get details from the link on the next line</p>

Please see the <details> (en-US) page for examples on <summary>.


HTML Standard
# the-summary-element

Browser compatibility

BCD tables only load in the browser

See also