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

Using CSS can I :hover over an image i have in a list <li> and make another image appear in its place?

I have given the image i would like to change to another image when hovered over an ID of "pic1". Its the very first image in the list ...

Here is my html list:

<div id="navpics">

<ul > <li > <img src="img/front_of_shop.jpg" id="pic1"></li> <li> <img src="img/navpic2.jpg"></li> <li><img src="img/frog.jpg"></li>
<li> <img src="img/navpic4.jpg"></li>

</div>

any help would be much appreciated !!!

1 Answer

Technically you could if your image was a background image. You'd have to nest it inside a div though.

Your code hasn't shown up, unfortunately.