2016-09-21 14 views
4

私はこのコード(JSFiddleも参照)を使用して、ホバー上の矢印の背景色を変更しています。しかし、矢印がクリックすると色が変わるだけなので、これは機能しません。<details><summary>要素の矢印のスタイル設定方法は?

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>

+0

[HTML5の詳細タグの拡張(▶)アイコンを交換してください]の可能複製(http://stackoverflow.com/questions/10813581/replace-the- expand-icon-of-html5-details-tag) –

答えて

6

:hoverdetailsタグ(ないsummary)であるべきです。

これを試してみてください、それが動作します:

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

ありがとう、 'これはうまく動作します:) – user3741124

+0

ようこそ.Happy to help :) –

関連する問題