<figure class="cp_caption">
<img src="img.jpg">
<figcaption>
<h2>タイトル</h2>
<p>テキスト</p>
<a href="#"></a>
</figcaption>
</figure>
figure.cp_caption {
line-height: 0;
position: relative;
overflow: hidden;
width: 100%;
min-width: 220px;
max-width: 300px;
max-height: 220px;
margin: 10px 1%;
color: #ffffff;
}
figure.cp_caption * {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
figure.cp_caption img {
width: 100%;
-webkit-transition: all 0.4s;
transition: all 0.4s;
opacity: 1;
}
figure.cp_caption h2 {
line-height: 1.6;
margin: 0;
padding: 0;
border-bottom: 1px solid #fff;
}
figure.cp_caption p {
line-height: 1.6;
margin: 0;
padding: 0;
}
figure.cp_caption:hover img {
-webkit-transform: translateY(-45px);
transform: translateY(-45px);
}
figure.cp_caption:hover figcaption {
-webkit-transition: -webkit-transform 0.3s, opacity 0.1s;
transition: transform 0.3s, opacity 0.1s;
-webkit-transform: translateY(0);
transform: translateY(0);
opacity: 1;
}
figure.cp_caption figcaption {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: auto;
padding: 0.5em;
-webkit-transition: -webkit-transform 0.35s, opacity 0.1s 0.3s;
transition: transform 0.35s, opacity 0.1s 0.3s;
-webkit-transform: translateY(100%);
transform: translateY(100%);
opacity: 0;
color: #ffffff;
background: rgba(27, 37, 56, 1);
}