HTML <details> Tag
In this tutorial, we will learn about details tag in HTML with the help of examples.
<details> Tag
Details tag <details> is used to specify additional content that the users can open and close when they want.
The <details> tag is usually used to create interative widget that the user can open and close.
We can put any type of content inside the <details> tag.
Syntax
<details>.....</details>
Example
<!DOCTYPE html>
<html>
<head>
<title>Details Tag</title>
</head>
<body>
<details>
<summary>HTML</summary>
<p>HTML is a markup language used to create website.</p>
</details>
</body>
</html>
Output
HTML
HTML is a markup language used to create website.
Specific Attribute
Attribute | Value | Description |
---|---|---|
open | open | Specifies that the details should be visible(open) to the user |
Global Attribute
Details Tag support all the global attributes of HTML.
Event Attribute
Details Tag support all the event attributes of HTML.
Next Tutorial
We hope that this tutorial helped you develop better understanding of the concept of details tag in HTML.
Keep Learning : )
In the next tutorial, you'll learn about HTML dfn
Tag.