hover操纵同级元素
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>hover操纵同级元素</title>
<style>
.first {
color: #f99;
}
.first:hover > .first-child {
color: #000
}
.first:hover + .second {
color: rgba(0, 0, 0, 0.38);
}
.first:hover + .second > .third {
color: #00F;
}
.first:hover + .fourth {
color: red
}
</style>
</head>
<body>
<div class='first'>trigger元素
<div class="first-child">子元素</div>
</div>
<div class='second'>同级相邻元素
<div class='third'>同级相邻元素子元素</div>
</div>
<div class="fourth">同级非相邻元素,无法改变</div>
</body>
</html>