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

How do I create a photo overlay?

I was watching the CSS transitions lecture about transitions on overlays. He showed how to make the transition with the overlay, but he didn't show how to create an overlay to begin with.

This is what I have so far:

html:

<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="overlaymain.css" media="screen"> <link rel="stylesheet" href="overlaytransition.css" media="screen"> </head> <body> <div class="photo container"> <div class="photo"> <img src="frog.jpg" alt="frog on pad"> <div class="photo-overlay"> <h3>A Frog</h3> <p>"This is a frog on a lillypad"</p> </div>
</div> </div> </body> </html>

CSS main:

img { width:300px; height:250px; }

CSS transitions:

.photo-overlay { opacity:0; transition-property: opacity; transition-duration: .1s; }

.photo-overlay:hover { opacity:1; }

This is what I have: http://i.imgur.com/2SDheCf.png Here is an example of what I want: http://i.imgur.com/Hj37zEY.png (the one on the bottom right)