hover指定元素可以是同级别元素不相邻的吗(son和test)

请问son的hover命令 能实现test的隐藏和显示吗


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        .father{
            height: 500px;
            width: 500px;
            background-color: aquamarine;
        }
        .child{
            height: 60px;
            width: 60px;
            margin-bottom: 20px;
            background-color: blueviolet;
        }
        .sonOld:hover{
            background-color: red;
        }
        .son:hover+.test {
            display: block;
        }
        .test{
            height: 50px;
            width: 100px;
            margin-bottom: 20px;
            background-color: blue;
            display: none;
        }
    </style>
</head>
<body>
    <div class="father">
        <div class="son child">
            <div class="grandson">a</div>
            <div class="grandsonOld">b</div>
            <div class="granddaughter">c</div>
            <div class="granddaughterOld">d</div>
        </div>
        <div class="sonOld child"></div>
        <div class="daughter child"></div>
        <div class="daughterOld child"></div>
        <div class="test"></div>
    </div>
</body>
</html>

https://blog.csdn.net/xiaoyou625/article/details/111027838

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632