也加过+但是一直失效也不知道为什么
+只能影响到下一个,像你这个只能用
.d:hover + .x{}
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.a{
background-color: #ccc;
width: 100px;
height: 100px;
}
.b{
background-color: #ccc;
width: 100px;
height: 100px;
display: none;
}
.a:hover + .b{
display: block;
}
</style>
</head>
<body>
<div class="a">
</div>
<div class="b">
</div>
</body>
</html>
```
我咋可以,你试试
.div:hover{}
检查下代码
你是想要挪到类x的时候改变它的背景色吗?
.x:hover {
background-color:red;
}