div.parent:hover {
color:#909090;
}
あなたのCSSは、「クラスの親でDIVタグを選択し、ホバー状態でのみ次のCSSを適用してから、フォントの色を#909090に変更してください」と言っています。
まず、子にホバー状態が必要な場合は、次のようにします。
/* explanation: select DIV tags with "child" class on hover state */
div.parent div:hover {
/* apply your CSS here */
}
一部のタグに特定の CSS を作成し、それを他のタグから除外する場合は、より具体的にします。任意のタグに複数のクラスを追加できます。たとえば、特別なホバー状態のために child1 と child2 に別のクラスを追加し、child3 から除外してみましょう。
<div class="parent">
<div class="child1 myHoverClass"></div>
<div class="child2 myHoverClass"></div>
<div class="child3"></div>
</div>
これを CSS で簡単に制御できるようになりました。
/* explanation: find parent class div, then select children DIV tags with class name "myHoverClass" and apply CSS for hover state only.. in this case, only child1 and child2 DIV tags */
div.parent div.myHoverClass:hover {
/* apply your CSS here */
}
注: CSS のスペースに注意してください。スペースは非常にデリケートであり、慎重に使用しないとまったく別の意味になる可能性があります。