HTML details tag

Oct 08 2020


Today I learned about the details tag in HTML which can be used for creating a collapsible widget with a label and information.

Pretty similar to the widget which I created for the TIL view of my previous website using JavaScript. I would have used it if I knew about it earlier.

It has a good browser support with only exceptions of Internet Explorer and Edge versions before 79.

Codepen link for a demo on details tag with some custom styling


MDN documentation on the Details