English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The HTML <details> element can create a collapsible component that only displays the contained information when it is expanded. The <summary> element can provide a summary or a label for the component.
Use the <details> element:
!doctype html <html> <head> <meta charset="UTF-8"> <title>HTML5 How to use the <details> tag (Basic Tutorial Website oldtoolbag.com)</title> </head> <body> <details> <summary>Details/summary> Something small enough to escape casual notice. (Basic Tutorial Website oldtoolbag.com) </details> </body> </html>Test and see ‹/›
How does it run:
IEFirefoxOperaChromeSafari
Currently, only Chrome and Safari 6 Supports <details> tag.
The <details> tag specifies additional details that are visible or hidden, as required by the user.
<details> tag is used to provide interactive controls for users to open and close. Any form of content can be placed inside the <details> tag.
The content of the <details> element is not visible to the user unless the open attribute is set.
<details> tag is an HTML5 in the new tag.
Tip:with <summary> Tags used together can define a title for details. The title is visible, and when the user clicks on the title, the details will be displayed.
New: HTML5 in the new attribute.
Attribute | Value | Description |
---|---|---|
openHTML5 | open | Specifies whether the details are visible. |
Support for <details> tag Global Attributes of HTML.
Support for <details> tag HTML Event Attributes.