How to style the arrow of <details> <summary> elements?

I use this code (also see JSFiddle ) to change the arrow background color on hover. However, this does not work, as the arrow changes color only by click.

summary::-webkit-details-marker {
  color: #B6B6B6;
  font-size: 20px;
  margin-right: 2px;
}
summary::-webkit-details-marker:hover {
  color: red;
}
<details class="DetailContainer">
  <summary>Step by Step Guides</summary>
  <details class="DetailsOne">
    <summary>Getting Started</summary>
    <p>1. Signup for a free trial</p>
  </details>
  <details class="DetailsOne">
    <summary>Setting up a backup schedule</summary>
    <p>This step assumes you have already signed up and installed the software</p>
  </details>
</details>
Run code
+4
source share
1 answer

:hovermust be in the tag details(and not summary).

Try it, it will work:

 details:hover summary::-webkit-details-marker:hover {
     color:red;
     background:white;
 }
+6
source

Source: https://habr.com/ru/post/1655368/


All Articles