Logo
HTMLCSSJavaScriptReactjsnewContactUpdates

Get started today

HTMLCSSJavaScriptReactjsnewContactUpdates

Tools

Resume BuilderQR GeneratorVS Code Editor

Connect

GitHubWhatsApp Channel
class and id
semantic tags

HTML Details and Summary Tag

By Saket Bhatnagar•July 1, 2025•Beginner to Intermediate

Table of Contents

  1. Details
  2. Summary
  3. Example

Details

  1. 1The details element represents a disclosure widget technically called as Accordian.
  2. 2It is a container tag.
  3. 3It is inline level element.
  4. 4The details tag is used for the content/ information which is initially hidden but could be displayed if the user wishesto see it.

Summary

  1. 1The summary element is used to provide caption or title to the details(Accordian).
  2. 2It is a container tag.
  3. 3It is inline level element.
  4. 4We have to use the summary tag within the details tag.

Example

  1. 1<details> <summary>New Delhi</summary> It is the capital of India. </details>
  2. 2In the above example, the <details> tag creates an Accordian and the <summary> tag is used to provide title to it. When the user clicks on the summary, the content inside the <details> tag is shown.

Share this article

Last updated: August 1, 2025

Join Our Community

Login to Join

© 2025 Saket Bhatnagar. All rights reserved.