According to WHATWG HTML5 Specification :
The details element represents a disclosure widget from which the user
can obtain additional information or controls.
The details
element is intended to create a widget that is intended to provide you with additional information about a content or to reveal a form control.
In this context, two elements are relevant, <details>
, which is the container for all content to show / hide and <summary>
, which contains the summary and the title of the section, being it optional, because if not is used, the browser will render a default text for the element.
With <details>
, you can change the visibility of comments in a blog, user profiles, download details, complex forms, or web applications as shown in the following example in the specifications:
To style the widget in enginesWebKit
you can use the pseudo class CSS ::-webkit-details-marker
.
details summary::-webkit-details-marker {
background: red;
color: #fff;
font-size: 500%;
}
For you to understand better, read the full article here .