DEV Community

Cover image for HTML tags | details-summary
Carlos Espada
Carlos Espada

Posted on • Edited on

1

HTML tags | details-summary

They are used to build an interactive element that shows or hides content on demand. The element responsible for this is the <summary>, which must be the first child of <details>. The rest of the content can be of any type.

By default the content appears hidden. If we want to show it initially we can use the open attribute in this way <details open>.

The <details> element can contain headings or any HTML that can be used within a <p> but, by having an implicit ARIA role button as well and removing all the roles assigned to the children, in case of using a heading this will not be discovered by assistive technologies as it is not treated as such.

  • Type: block / list-item
  • Self-closing: No / No
  • Semantic value: Yes / Yes

Definition and example <details> - Definition and example <summary> | Support

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more