Categories
Web development

HTML details Tag

Learn how to use the HTML details Tag.


HTML details Tag

The HTML <details> tag defines additional information that the user can open and close on demand.

Note: The HTML <summary> element is used in conjunction with the <details> tag to define a visible heading for the information.

Example:

<!DOCTYPE html>
<html>
<body>

<details>
  <summary>HTML</summary>
  <p>HTML defines the structure of the web page.</p>
</details>

</body>
</html>

Output:

HTML

HTML defines the structure of the web page.

Attributes:

open – defines that the details/ information should be visible to the user.

Read also:

HTML datalist tag

HTML picture Tag

HTML Select, Option and Optgroup tags