I have a little thumbnail that shows the title of an image. When you hover over it, the overlay spreads over the entire image and the button "learn more" will show as well. This is a fiddle of what I have so far:
My HTML:
<section id="industries"> <article> <img src="http://i.imgur.com/jgEoqTy.jpg" alt="" /> <div class="caption"> <span>Golf Courses</span> <a href="#" title="Learn more" class="button">Learn more</a> </div> </article> <article> <img src="http://i.imgur.com/jgEoqTy.jpg" alt="" /> <div class="caption active"> <span>Land Owners</span> <a href="#" title="Learn more" class="button">Learn more</a> </div> </article> <article> <img src="http://i.imgur.com/jgEoqTy.jpg" alt="" /> <div class="caption"> <span>Landscape Contractors</span> <a href="#" title="Learn more" class="button">Learn more</a> </div> </article> </section> And my CSS:
#industries article { float: left; width: 33.33333%; position: relative; } #industries article img { max-width: 100%; } #industries article .caption { position: absolute; box-sizing: border-box; width: 100%; background-color: rgba(24, 66, 113, 0.65); color: #fff; text-align: center; font-weight: bold; text-transform: uppercase; padding: 9px 14px; bottom: 0; height: auto; transition: height 0.25s ease-out; } #industries article .caption span { display: block; } #industries article .caption .button { background-color: #b50937; border-color: #b50937; display: none; color: #fff; padding: 10px 30px; text-transform: uppercase; text-align: center; cursor: pointer; } #industries article:hover .caption { height: 100%; padding-top: 40px; transition: height 0.25s ease-in; } #industries article:hover .caption span { margin-bottom: 25px; } #industries article:hover .caption .button { display: inline-block; text-decoration: none; } However, I have tried min-height and max-height, but obviously the max-height won't work since the text doesn't even take up the entire space initially so it's only going to go to the height of the text. And when I set the height attribute to 100% it just jolts up without the transition again.
Any help would be appreciated! I want the overlay to slowly slide up and the learn more button to fade in (but I can do that later once I get the slide to work).
height: 36px;) to 100%?. woudn't it work? (add also overflow hidden to#industries article