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 trialkaran Badhwar
Web Development Techdegree Graduate 18,135 Pointsbutton and image collapse
As in this video the images in the upper row collapsed and are coming over the content, but why in the lower row the button is coming over the images?
1 Answer
Jason Larson
8,361 PointsIn the top row, there is just a div (photo-container) with an img in it. In the other 2 rows, there is a div (photo-container) with a div (photo, and photo slide) nested inside it, with another div (photo-overlay) nested inside that div. This puts the photo as the bottom layer, with the overlay on top of it. The css has it moved out of sight until you hover over it, where the photo-overlay:hover definition pulls it back in to view on top of the photo. The transitions on the image in the first row cause the image to move around relative to its original position, which causes it to be pulled out of the flow and float over other elements because the transition doesn't fundamentally alter the document structure.