3

I have a summary in a details element:

<details>
  <summary>Hello</summary>
</details>

I have tried:

summary {
  display: block; /* works in firefox */
  list-style: none; /* works in firefox */
}

/* didn't work in any browser */
summary::marker,
summary::-webkit-details-marker {
  display: none;
}

/* Solution for Chrome and Safari? */

From this question How can you hide the arrow that is displayed by default on the HTML5 <details> element in Chrome?.

But none of those solutions actually works in chrome.

How do I remove this arrow in chrome too?

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
swift-lynx
  • 3,219
  • 3
  • 26
  • 45
  • 4
    `details summary::-webkit-details-marker { display:none; }` (copied from the link in your question) does work in Chrome v80 https://jsfiddle.net/e2jLzumd/ – GreyRoofPigeon Mar 24 '20 at 10:50
  • 2
    `details > summary::-webkit-details-marker { display: none; }` works for me in chrome 80, too. See bottom of this page: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details#Customizing_the_disclosure_widget – Papooch Mar 24 '20 at 10:58
  • 1
    remove the line: `summary::marker,` from your css - it seems to be breaking chrome – Pete Mar 24 '20 at 11:32
  • This should be the right answer – Eoin Nov 13 '20 at 23:09

3 Answers3

4

This works for me!

summary::marker {
  content: "";
}
Luca De Nardi
  • 2,280
  • 16
  • 35
mmk
  • 43
  • 4
-1
summary {
  &::marker {
    content: "";
  }
}
Mike
  • 1
-4
    <!DOCTYPE html>
    <html>

    <head>
        <title>Page Title</title>
        <style>
            summary {
                display: block;
                /* works in firefox */
                list-style: none;
                /* works in firefox */
            }

            summary::after {
                display: block;
                list-style: none;
            }

            summary::-webkit-details-marker {
                display: none;
            }
        </style>
    </head>

    <body>

        <details>
            <summary>Hello</summary>
        </details>

    </body>

    </html>
  • 2
    You seem to have copy/pasted the code from the question that the OP says doesn't work. There's no explanation about what, if anything, you've changed or why it should solve the problem. – Quentin Mar 24 '20 at 11:12
  • @Quentin: not quite, they used `summary::after` instead of `summary::marker`. Not that just posting the code without explanation makes this a helpful answer. – Martijn Pieters Mar 24 '20 at 12:35