Skip to content
Related Articles

Related Articles

Improve Article

HTML 5 <summary> Tag

  • Difficulty Level : Basic
  • Last Updated : 28 Jun, 2021

The <summary> tag in HTML is used to define a summary for the <details> element. 

  • The <summary> element is used along with the <details> element and provides a summary visible to the user.
  • When the summary is clicked by the user, the content placed inside the <details> element becomes visible which was previously hidden.
  • The <summary> tag was added in HTML 5.
  • The <summary> tag requires both starting and ending tag.

Syntax: 

<summary> Content </summary>

Below program illustrates the <summary> element:
Input :
 

HTML




<!DOCTYPE html>
<html>
<body>
 
<details>
  <!-- html summary tag is used here -->
  <summary>GeeksforGeeks.</summary>
   
<p> It is a portal for geeks.</p>
 
</details>
 
</body>
</html>

Output : 
 

Supported Browsers: 

  • Google Chrome 12.0
  • Firefox 48.0
  • Opera 15.0
  • Safari 6.0

 

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :