当我将鼠标悬停在另一个 div 上时,我无法让这些 div 显示框阴影。我让它在 Jsfiddle 中工作,但是当应用于这些 div 时它不起作用,我不知道为什么。我已经包含了原始(工作)Jsfiddle 和这个(非工作版本)以进行比较。我不明白为什么它不起作用,因为唯一的区别是它们具有不同的类和 id 名称。
以下是我当前的代码:
CSS:
.SideContainer {
    width: 35%;
    height: 100%;
    text-align: center;
    background-color: #4274aa;
    opacity: 0.6;
}
    .SideContainer h1 {
        color: white;
    }
    .SideContainer a {
        margin: 321px 0 0 0;
    padding: 10px 15px 10px 15px;
    background-color: #05337e;
    color: white;
    display: inline-block;
    }
.LeftSide {
    float: left;
    background-color: blue;
}
    .LeftSide:hover ~ #TLHOOK , .LeftSide:hover ~ #BLHOOK {
    /* Sided box-shadow */
    box-shadow: 6px 0px 10px -7px #111, -6px 0px 10px -7px #111;
    }
HTML:
<section id="ServicesGroup">
    <div class="Centered">
        <!-- Let the magic happen. -->
        <section id="TLHOOK" class="LeftSide SideContainer">
            <div class="TopHeadingShell">
                <img src="~/Shared/Assets/Images/HTML5LogoWithWhiteText.png" />
                <h1>sdsd</h1>
            </div>
        </section>
        <section id="TRHOOK" class="RightSide SideContainer">
            <div class="TopHeadingShell">
                <img src="~/Shared/Assets/Images/GearsIcon.png" />
                <h1>sdsd</h1>
            </div>
        </section>
    </div>
</section>
<section id="ServicesGroupExtended">
    <div class="Centered">
        <!-- Let the magic happen. -->
        <section id="BLHOOK" class="LeftSide SideContainer">
            <a href="~/Shared/Services/sdsd">Packages & Pricing</a>
        </section>
        <section class="Bottom MiddleContainer">
            <h2>
                something here
            </h2>
            <br />
            <a href="~/Shared/About">Learn More</a>
        </section>
        <section id="BRHOOK" class="RightSide SideContainer">
            <a href="~/Shared/Services/sdsd">Packages & Pricing</a>
        </section>
    </div>
</section>
这是工作的JSFiddle 和不工作的(我需要工作的)一个。请不要介意最后一个示例中的定位 - 只需将鼠标悬停在您看到的第一个 div 上,您就会发现它在我链接到的第二个示例中不起作用。
为什么这没有按预期工作?我的意思是,唯一不同的是类名和 id 名发生了变化,就像,我认为它会起作用?