HTML <details> Tag
Description
The <details>
HTML element is used to store information that can be hidden or shown at the request of the user. By default, the contents of the element are not displayed; the open attribute is used to change the status.
Initially, the contents of the <details>
are hidden, instead of it the text "Details" is displayed, clicking on which hides or shows the contents of the element.
Properties
- Permitted Parents
- Any element that accepts flow content
- Content
- Block, inline and text
- Start/End Tags
- Start tag: required, End tag: required
Example
<details>
<summary>About CSSPortal</summary>
<p>CSSPortal is a site dedicated to helping you with CSS.</p>
</details>
Attributes
Attribute | Definition |
---|---|
open | Specifies whether the details should be open (visible to the user) or closed (hidden from the user). |
Global Attributes
The <details>
tag also supports the Global Attributes in HTML5
Event Attributes
The <details>
tag also supports the Event Attributes in HTML5
Browser Support
Desktop | |||||
X | X | 12 | 49 | 15 | 6 |
Tablets / Mobile | |||||
![]() |
|||||
Yes | Yes | 49 | 14 | 6.1 | Yes |
Last updated by CSSPortal on: 6th December 2019
HTML Tags
- a
- abbr
- address
- area
- article
- aside
- audio
- b
- base
- bdi
- bdo
- blockquote
- body
- br
- button
- canvas
- caption
- cite
- code
- col
- colgroup
- comment
- datalist
- dd
- del
- details
- dfn
- dialog
- div
- dl
- doctype
- dt
- em
- embed
- fieldset
- figcaption
- figure
- footer
- form
- h1
- h2
- h3
- h4
- h5
- h6
- head
- header
- hr
- html
- i
- iframe
- img
- input
- ins
- kbd
- keygen
- label
- legend
- li
- link
- map
- mark
- menu
- meta
- meter
- nav
- noscript
- object
- ol
- optgroup
- option
- output
- p
- param
- picture
- pre
- progress
- q
- rp
- rt
- ruby
- s
- samp
- script
- section
- select
- small
- source
- span
- strong
- style
- sub
- summary
- sup
- table
- tbody
- td
- textarea
- tfoot
- th
- thead
- time
- title
- tr
- track
- u
- ul
- var
- video
- wbr