Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Unused CSS Stages Transitions and Transforms Transitions: Part 2

Not sure what this means

Hi, I'm doing transitions and I've come across some code that I don't exactly understand. It goes…

.wrap:hover .box{ margin-left:75%; background:rgba(0,100,30, 0.8); }

so, when I read it, it seems that the background color and margin change when the mouse is over the .wrap div. But I'm not sure why the .box div is there. If anyone could help that'd be great…thanks!

2 Answers

Jacob Miller
Jacob Miller
12,466 Points

The .box div will change when you hover over the .wrap div. Just like the CSS selector .wrap .box will select all div's with the class of .box inside the div with the class of .wrap, .wrap:hover .box will select all div's with the class of .box inside the div with the class of .wrap when it is hovered over.

Thanks Jacob.