📜  在类上悬停另一个类颜色变化 - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:25.504000             🧑  作者: Mango

代码示例1
/* For wrapper is a child of item */
.item:hover .wrapper {
    color: #fff;
    background-color: #000;
}

/* For wrapper is another div and item is another */
.item:hover ~ .wrapper {
    color: #fff;
    background-color: #000;
}