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
Jake Porritt
10,356 PointsHover over link not working
Hi,
I've created a div with a a href element in it. I'm trying to make it change background and font colour when a user hovers not just over the link but the entire div section itself. At the moment when the mouse hovers over the div the background changes colour which is correct but the font stays the same colour until the mouse hovers over the link text.
Here is the code:
<div class="feedback">
<a href="http://twitter.com/home?status= @1919_lufc">
Tweet us what you think to Essen!
</a>
</div>
.feedback:hover { background: #FF525A; }
.feedback a:hover { color: white; }
1 Answer
Jake Lundberg
13,965 PointsCurrently, your link would only change color when you hover over the link itself, not the div. If you want the link to change color when you over over the div, you could do this:
.feedback:hover a {
color: white;
}