以下のように記述すると特定の子要素にホバーしていない場合にのみスタイルを適用できます。
div:not(:has(要素:hover)) {
}
以下の場合、子要素のボタンにホバーしていなければdiv
の背景色が青になる
div:not(:has(button:hover)) {
background: #0000ff;
}
Go to list of users who liked
More than 1 year has passed since last update.
以下のように記述すると特定の子要素にホバーしていない場合にのみスタイルを適用できます。
div:not(:has(要素:hover)) {
}
以下の場合、子要素のボタンにホバーしていなければdiv
の背景色が青になる
div:not(:has(button:hover)) {
background: #0000ff;
}
Register as a new user and use Qiita more conveniently
Go to list of users who liked