<summary>
Example
summary {
list-style: none;
}summary {
list-style: none;
}
summary::-webkit-details-marker {
display: none;
}Safari draws the marker with a WebKit pseudo-element, so both rules are needed to hide the arrow everywhere.
Common mistakes
- Putting a
<button>inside<summary>, which creates nested interactive controls. - Hiding the marker with
list-style: noneonly, leaving it visible in Safari.
Key points
<summary>is the first child of a<details>element.<summary>contains no buttons, links or other interactive elements.- Hiding the arrow also covers WebKit with
summary::-webkit-details-marker.
Interview questions
Can I put a heading inside summary?
Yes, it is valid, but <summary> acts as a button, so some screen readers do not announce the heading level.
What happens if details has no summary?
The browser shows a default label such as 'Details'. Always add your own <summary> with clear text.
How do I style the summary arrow?
Use summary::marker to change its color or content, or hide it and add your own icon with ::before.