HTML5 <summary> Tag

The HTML <summary> tag is used as a summary, caption, or legend for the content of a <details> element. If the <summary> element is omitted, the heading “details” will be used.

The only content permitted inside this element is phrasing content or one element of heading content. Both the starting and ending tag are mandatory for this element. The parent of the <summary> tag can be the <details> element.

The following style is applied to this element by default:

summary {
  display: block;

Here is an example of using this tag:

<section class="progress window">
  <h4>Copying "Lord of The Rings"</h4>
    <summary>Copying... <progress max="375505392" value="97543282"></progress> 25%</summary>
      <dt>Transfer rate:</dt> 
      <dt>Local filename:</dt> 
      <dt>Remote filename:</dt> 
      <dt>Color profile:</dt> 
      <dd>SD (6-1-6)</dd>


This element only accepts global attributes.


See the Pen HTML summary Tag by Tutorialio (@tutorialio) on CodePen.

Further Reading

  1. Read more about the HTML <summary> element on MDN.
  2. You can also read the HTML <summary> tag reference on W3C.

Reader Comments

1. You can register or login to post a comment. Asking readers to register improves the quality of discussion.

2. As a registered user, you will also get to access features like choosing between a light and dark theme or anything else that we might implement in future.

Follow Us For Updates

Go To Top