user2705526
user2705526

Reputation: 83

Change background of child if parent :hover

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>

Upvotes: 8

Views: 3371

Answers (1)

iConnor
iConnor

Reputation: 20209

Like so.

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

No jQuery - Everyone's happy :)

Upvotes: 15

Related Questions