<figure class="cp_caption">
<img src="img.jpg">
<figcaption>
<h2>タイトル</h2>
<p>テキスト</p>
<a href="#"></a>
</figcaption>
</figure>
figure.cp_caption {
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%;
height: 100%;
}
figure.cp_caption figcaption {
position: absolute;
z-index: 1;
top: 50%;
padding: 3em 3em;
transition: all 0.3s ease-out;
transition-delay: 0.1s;
opacity: 0;
}
figure.cp_caption:after {
position: absolute;
top: 7%;
right: 10%;
bottom: 7%;
left: 10%;
display: inline-block;
content: '';
transition: all 0.3s ease-out;
opacity: 0;
background: rgba(27, 37, 56, 0.8);
}
figure.cp_caption:hover:after {
opacity: 0.9;
}
figure.cp_caption:hover figcaption {
transform: translateY(-50%);
opacity: 1;
}
<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);
}
<figure class="cp_caption">
<img src="img.jpg">
<figcaption>
<h2>タイトル</h2>
<p>テキスト</p>
<a href="#"></a>
</figcaption>
</figure>
figure.cp_caption {
position: relative;
overflow: hidden;
width: 100%;
min-width: 220px;
max-width: 300px;
max-height: 220px;
margin: 10px 1%;
text-align: center;
color: #fff;
background: rgba(27, 37, 56, 1);
}
figure.cp_caption * {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
figure.cp_caption img {
width: 100%;
-webkit-transition: opacity 0.3s;
transition: opacity 0.3s;
opacity: 1;
}
figure.cp_caption figcaption {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
padding: 3em 3em;
}
figure.cp_caption figcaption::before {
position: absolute;
top: 50%;
right: 30px;
bottom: 50%;
left: 30px;
content: '';
-webkit-transition: all 0.4s;
transition: all 0.4s;
-webkit-transition-delay: 0.2s;
transition-delay: 0.2s;
opacity: 0;
border-top: 1px solid rgba(255, 255, 255, 0.8);
border-bottom: 1px solid rgba(255, 255, 255, 0.8);
background-color: #fff;
}
figure.cp_caption h2,
figure.cp_caption1 p {
margin: 0 0 5px;
-webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
transition: opacity 0.3s, transform 0.3s;
opacity: 0;
}
figure.cp_caption a {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
color: #fff;
}
figure.cp_caption:hover img {
opacity: 0.35;
}
figure.cp_caption:hover figcaption h2 {
-webkit-transition-delay: 0.3s;
transition-delay: 0.3s;
-webkit-transform: translate3d(0%, 0%, 0);
transform: translate3d(0%, 0%, 0);
opacity: 1;
}
figure.cp_caption:hover figcaption p {
-webkit-transition-delay: 0.2s;
transition-delay: 0.2s;
opacity: 0.9;
}
figure.cp_caption:hover figcaption::before {
top: 30px;
bottom: 30px;
-webkit-transition-delay: 0s;
transition-delay: 0s;
opacity: 1;
background: rgba(27, 37, 56, 0);
}
<figure class="cp_caption">
<img src="img.jpg">
<figcaption>
<div><h2>タイトル</h2></div>
<div><p>テキスト</p></div>
<a href="#"></a>
</figcaption>
</figure>
figure.cp_caption {
position: relative;
overflow: hidden;
width: 100%;
min-width: 220px;
max-width: 300px;
max-height: 220px;
margin: 10px 1%;
text-align: center;
color: #fff;
background: rgba(27, 37, 56, 1);
}
figure.cp_caption * {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
figure.cp_caption img {
width: 100%;
-webkit-transition: opacity 0.3s;
transition: opacity 0.3s;
opacity: 1;
}
figure.cp_caption figcaption {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
text-align: left;
}
figure.cp_caption figcaption > div {
position: relative;
float: left;
overflow: hidden;
width: 50%;
height: 100%;
}
figure.cp_caption figcaption::before {
position: absolute;
top: 50%;
bottom: 50%;
left: 50%;
width: 2px;
content: '';
-webkit-transition: all 0.4s;
transition: all 0.4s;
-webkit-transition-delay: 0.2s;
transition-delay: 0.2s;
opacity: 0;
background-color: rgba(255, 255, 255, 0);
}
figure.cp_caption h2,
figure.cp_caption p {
position: absolute;
top: 0;
left: 0;
width: 100%;
margin: 0;
padding: 20px;
-webkit-transition: opacity 0.4s, -webkit-transform 0.4s;
transition: opacity 0.4s, transform 0.4s;
opacity: 0;
}
figure.cp_caption h2 {
bottom: 0;
display: inline-block;
-webkit-transition-delay: 0s;
transition-delay: 0s;
-webkit-transform: translate3d(50%, 0%, 0);
transform: translate3d(50%, 0%, 0);
text-align: right;
word-spacing: -0.1em;
background: rgba(0, 0, 0, 0.5);
}
figure.cp_caption p {
font-weight: 300;
top: 0;
bottom: 0;
display: block;
-webkit-transition-delay: 0s;
transition-delay: 0s;
-webkit-transform: translate3d(-50%, 0%, 0);
transform: translate3d(-50%, 0%, 0);
text-align: left;
color: rgba(27, 37, 56, 1);
background: #fff;
}
figure.cp_caption a {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
color: #fff;
}
figure.cp_caption:hover img {
opacity: 0.7;
}
figure.cp_caption:hover figcaption h2,
figure.cp_caption:hover figcaption p {
-webkit-transition-delay: 0.3s;
transition-delay: 0.3s;
-webkit-transform: translate3d(0%, 0%, 0);
transform: translate3d(0%, 0%, 0);
}
figure.cp_caption:hover figcaption h2 {
opacity: 1;
}
figure.cp_caption:hover figcaption p {
opacity: 1;
}
figure.cp_caption:hover figcaption::before {
top: 0;
bottom: 0;
-webkit-transition-delay: 0s;
transition-delay: 0s;
opacity: 1;
background: #fff;
}
<figure class="cp_caption">
<img src="img.jpg">
<figcaption>
<h2>タイトル</h2>
<p>テキスト</p>
<a href="#"></a>
</figcaption>
</figure>
figure.cp_caption {
position: relative;
overflow: hidden;
width: 100%;
min-width: 220px;
max-width: 300px;
max-height: 220px;
margin: 10px 1%;
text-align: left;
color: #fff;
background: rgba(27, 37, 56, 1);
}
figure.cp_caption * {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
figure.cp_caption img {
width: 100%;
max-width: 100%;
-webkit-transition: opacity 0.35s;
transition: opacity 0.35s;
opacity: 1;
}
figure.cp_caption figcaption {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
padding: 30px 3em;
}
figure.cp_caption figcaption::before {
position: absolute;
top: 30px;
right: 30px;
bottom: 30px;
left: 100%;
content: '';
-webkit-transition: all 0.4s;
transition: all 0.4s;
-webkit-transition-delay: 0.2s;
transition-delay: 0.2s;
opacity: 0;
border-left: 4px solid rgba(255, 255, 255, 0.8);
background-color: rgba(255, 255, 255, 0.5);
}
figure.cp_caption h2,
figure.cp_caption p {
margin: 0 0 5px;
-webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
transition: opacity 0.3s, transform 0.3s;
opacity: 0;
}
figure.cp_caption h2 {
-webkit-transition-delay: 0s;
transition-delay: 0s;
-webkit-transform: translate3d(30%, 0%, 0);
transform: translate3d(30%, 0%, 0);
}
figure.cp_caption p {
-webkit-transition-delay: 0s;
transition-delay: 0s;
-webkit-transform: translate3d(0%, 30%, 0);
transform: translate3d(0%, 30%, 0);
}
figure.cp_caption a {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
color: #fff;
}
figure.cp_caption:hover img {
opacity: 0.3;
}
figure.cp_caption:hover figcaption h2 {
-webkit-transition-delay: 0.2s;
transition-delay: 0.2s;
-webkit-transform: translate3d(0%, 0%, 0);
transform: translate3d(0%, 0%, 0);
opacity: 1;
}
figure.cp_caption:hover figcaption p {
-webkit-transition-delay: 0.2s;
transition-delay: 0.2s;
-webkit-transform: translate3d(0%, 0%, 0);
transform: translate3d(0%, 0%, 0);
opacity: 0.9;
}
figure.cp_caption:hover figcaption::before {
left: 30px;
-webkit-transition-delay: 0s;
transition-delay: 0s;
opacity: 1;
background: rgba(255, 255, 255, 0);
}
<figure class="cp_caption">
<img src="img.jpg">
<figcaption>
<h2>タイトル</h2>
<p>テキスト</p>
<a href="#"></a>
</figcaption>
</figure>
figure.cp_caption {
position: relative;
overflow: hidden;
width: 100%;
min-width: 220px;
max-width: 300px;
max-height: 220px;
margin: 10px 1%;
text-align: right;
color: #fff;
background: rgba(27, 37, 56, 1);
}
figure.cp_caption * {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
figure.cp_caption img {
width: 100%;
-webkit-transition: opacity 0.3s;
transition: opacity 0.3s;
opacity: 1;
}
figure.cp_caption figcaption {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
padding: 30px 3em;
}
figure.cp_caption figcaption::before {
position: absolute;
top: 30px;
right: 100%;
bottom: 30px;
left: 30px;
content: '';
-webkit-transition: all 0.4s;
transition: all 0.4s;
-webkit-transition-delay: 0.2s;
transition-delay: 0.2s;
opacity: 0;
border-right: 4px solid rgba(255, 255, 255, 0.8);
background-color: rgba(255, 255, 255, 0.5);
}
figure.cp_caption h2,
figure.cp_caption p {
margin: 0 0 5px;
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
opacity: 0;
}
figure.cp_caption h2 {
-webkit-transition-delay: 0s;
transition-delay: 0s;
-webkit-transform: translate3d(-30%, 0%, 0);
transform: translate3d(-30%, 0%, 0);
}
figure.cp_caption p {
-webkit-transition-delay: 0s;
transition-delay: 0s;
-webkit-transform: translate3d(0%, -30%, 0);
transform: translate3d(0%, -30%, 0);
}
figure.cp_caption a {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
color: #fff;
}
figure.cp_caption:hover img {
opacity: 0.3;
}
figure.cp_caption:hover figcaption h2,
figure.cp_caption:hover figcaption p {
visibility: visible;
}
figure.cp_caption:hover figcaption h2 {
-webkit-transition-delay: 0.2s;
transition-delay: 0.2s;
-webkit-transform: translate3d(0%, 0%, 0);
transform: translate3d(0%, 0%, 0);
opacity: 1;
}
figure.cp_caption:hover figcaption p {
-webkit-transition-delay: 0.2s;
transition-delay: 0.2s;
-webkit-transform: translate3d(0%, 0%, 0);
transform: translate3d(0%, 0%, 0);
opacity: 0.9;
}
figure.cp_caption:hover figcaption::before {
right: 30px;
-webkit-transition-delay: 0s;
transition-delay: 0s;
opacity: 1;
background: rgba(255, 255, 255, 0);
}