如果父母:悬停,请更改孩子的背景 [英] Change background of child if parent :hover

查看:94
本文介绍了如果父母:悬停,请更改孩子的背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果要悬停posts-item,我想更改.circle.icon的bg颜色.知道如何做到这一点,可能没有Java语言吗?

I want to change the bg-color of .circle.icon if posts-item is hovered. Any idea how to accomplish that, possibly without Javascript?

<div id="scr1" class="large-6 columns timeline">
    <div class="line"></div>
    <ul class="posts">
        <li class="posts-item">
            <div class="circle icon"></div>
             <h2 class="posts-item-title">
                 <a href=""></a>
              </h2>
            <p class="summary"></p>
        </li>
    </ul>
</div>

推荐答案

类似.

.posts-item:hover .circle.icon {
    background: green;
}

没有jQuery-每个人都很高兴:)

No jQuery - Everyone's happy :)

这篇关于如果父母:悬停,请更改孩子的背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆