<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<style>
.wrap{
width:100px;
height:100px;
background: red;
position: relative;
}
.wrap:hover .son{
background: black;
}
.son{
width:50px;
height: 50px;
background: gainsboro;
position: absolute;
left:800px;
}
</style>
<body>
<div class="wrap">
<div class="son"></div>
</div>
</body>
<script>
</script>
</html>
左边是父,右边是子,给父设置hover ,也相当于给子加了hover