Logo
HTMLCSSJavaScriptReactjsnewResourcesContactUpdates
Join

Get started today

HTMLCSSJavaScriptReactjsnewResourcesContactUpdates

Tools

Resume BuilderQR GeneratorVS Code Editor

Connect

GitHubWhatsApp Channel
class and id
semantic tags

HTML Details and Summary Tag

By Saket Bhatnagar•December 16, 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: January 16, 2026

Saket Bhatnagar

I build products, share the playbooks, and pass along everything I learn so you can ship faster.

GitHubLinkedInYouTubeWhatsApp Channel

Quick Links

  • Updates
  • Resources
  • Resume Builder
  • Contact

WhatsApp

Builders Group

Real-time notes from my builds, weekend challenges, and accountability threads.

Shipping Notes Channel

Launch alerts + bite-sized lessons.

© 2025 Saket Bhatnagar. All rights reserved.

Always building, always learning.