コピペでできる!cssとhtmlのみで作るチョイ見せできるアコーディオンスライド 8選

CSS HTML
Update 2018.05.07

普段はあまり面積を使わず、ホバーで表示するアコーディオンスライドはアイテムの多いサイトなどによく活用されます。
内容をチョイ見せできるので、使い勝手が良いですね。
基本的なアコーディオンの動きは同じですが、中身(テキスト)の表示にそれぞれのエフェクトをつけています。

レスポンシブについては、基本下記にて設定しています。
@media only screen and (max-width:768px){}

browser:  65 11 20 11 

チョイ見せできるアコーディオンスライド[8選]

ホバーで動く基本的なアコーディオンスライド

ニャン易度

Section 1

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Section 2

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Section 3

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Section 4

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Section 5

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

<div class="cp_accordionslide01">
<div class="slideitem">
<h2>タイトル 1</h2>
<div class="slidecont">
<p>テキスト 1</p>
</div>
</div>
<div class="slideitem">
<h2>タイトル 2</h2>
<div class="slidecont">
<p>テキスト 2</p>
</div>
</div>
<div class="slideitem">
<h2>タイトル 3</h2>
<div class="slidecont">
<p>テキスト 3</p>
</div>
</div>
<div class="slideitem">
<h2>タイトル 4</h2>
<div class="slidecont">
<p>テキスト 4</p>
</div>
</div>
<div class="slideitem">
<h2>タイトル 5</h2>
<div class="slidecont">
<p>テキスト 5</p>
</div>
</div>
</div>
.cp_accordionslide01 {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
visibility: hidden;
width: 100%;
height: 60vh;
}
.cp_accordionslide01 .slideitem {
position: relative;
visibility: visible;
width: 20%;
height: 100%;
cursor: pointer;
-webkit-transition: all 0.5s ease-out;
transition: all 0.5s ease-out;
}
.cp_accordionslide01 .slideitem:nth-child(1) {
background: #4fc3f7;
}
.cp_accordionslide01 .slideitem:nth-child(2) {
background: #4dd0e1;
}
.cp_accordionslide01 .slideitem:nth-child(3) {
background: #4db6ac;
}
.cp_accordionslide01 .slideitem:nth-child(4) {
background: #81c784;
}
.cp_accordionslide01 .slideitem:nth-child(5) {
background: #aed581;
}
.cp_accordionslide01:hover .slideitem:hover {
width: 60%;
}
.cp_accordionslide01 .slideitem h2 {
font-size: 1.4em;
padding: 0.5em;
}
.cp_accordionslide01 .slideitem p {
padding: 0.5em;
}
@media only screen and (max-width:768px) {
.cp_accordionslide01 .slideitem h2 {
font-size: 0.8em;
word-wrap: break-word;
}
.cp_accordionslide01 .slideitem p {
font-size: 0.7em;
word-wrap: break-word;
}
.cp_accordionslide01 .slideitem {
width: 20%;
}
.cp_accordionslide01:hover .slideitem {
width: 15%;
}
}

背景に画像を使ったホバーでテキストが降りてくるスライド

ニャン易度

Section 1

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 2

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 3

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 4

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 5

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

<div class="cp_accordionslide02">
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 1</h2>
<div class="text">
<p>テキスト 1</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 2</h2>
<div class="text">
<p>テキスト 2</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 3</h2>
<div class="text">
<p>テキスト 3</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 4</h2>
<div class="text">
<p>テキスト 4</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 5</h2>
<div class="text">
<p>テキスト 5</p>
</div>
</div>
</div>
</div>
.cp_accordionslide02 {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
visibility: hidden;
width: 100%;
height: 60vh;
}
.cp_accordionslide02 .slideitem {
position: relative;
visibility: visible;
overflow: hidden;
width: 20%;
height: 100%;
cursor: pointer;
-webkit-transition: all 0.3s linear 0s;
transition: all 0.3s linear 0s;
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}
.cp_accordionslide02 .slideitem:nth-child(1) {
background-image: url('img/sample6.jpg');
}
.cp_accordionslide02 .slideitem:nth-child(2) {
background-image: url('img/sample7.jpg');
}
.cp_accordionslide02 .slideitem:nth-child(3) {
background-image: url('img/sample8.jpg');
}
.cp_accordionslide02 .slideitem:nth-child(4) {
background-image: url('img/sample9.jpg');
}
.cp_accordionslide02 .slideitem:nth-child(5) {
background-image: url('img/sample10.jpg');
}
.cp_accordionslide02 .slideitem:after {
position: absolute;
z-index: 2;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
content: '';
opacity: 0;
}
.cp_accordionslide02:hover .slideitem:hover {
width: 60%;
}
.cp_accordionslide02 .slideitem .slidecont {
position: absolute;
z-index: 4;
bottom: 60px;
left: 30px;
visibility: hidden;
max-width: 400px;
padding: 20px;
color: #ffffff;
border-radius: 5px;
background-color: rgba(230,74,25 ,0.8);
}
.cp_accordionslide02 .slideitem .slidecont h2 {
font-size: 1.4em;
}
.cp_accordionslide02:hover .slideitem:hover .slidecont {
bottom: 30px;
visibility: visible;
-webkit-transition: all 0.2s linear 0.5s;
transition: all 0.2s linear 0.5s;
opacity: 1;
}
@media only screen and (max-width:768px) {
.cp_accordionslide02 {
height: 80vh;
}
.cp_accordionslide02 .slideitem .slidecont h2 {
font-size: 0.9em;
}
.cp_accordionslide02 .slideitem .slidecont p {
font-size: 0.7em;
}
.cp_accordionslide02 .slideitem .slidecont {
right: 10px;
left: 10px;
}
}

背景に画像を使ったホバーでテキストが横から出てくるスライド

ニャン易度

Section 1

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 2

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 3

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 4

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 5

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

<div class="cp_accordionslide03">
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 1</h2>
<div class="text">
<p>テキスト 1</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 2</h2>
<div class="text">
<p>テキスト 2</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 3</h2>
<div class="text">
<p>テキスト 3</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 4</h2>
<div class="text">
<p>テキスト 4</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 5</h2>
<div class="text">
<p>テキスト 5</p>
</div>
</div>
</div>
</div>
.cp_accordionslide03 {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
visibility: hidden;
width: 100%;
height: 60vh;
}
.cp_accordionslide03 .slideitem {
position: relative;
visibility: visible;
overflow: hidden;
width: 20%;
height: 100%;
cursor: pointer;
-webkit-transition: all 0.3s linear 0s;
transition: all 0.3s linear 0s;
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}
.cp_accordionslide03 .slideitem:nth-child(1) {
background-image: url('img/sample11.jpg');
}
.cp_accordionslide03 .slideitem:nth-child(2) {
background-image: url('img/sample12.jpg');
}
.cp_accordionslide03 .slideitem:nth-child(3) {
background-image: url('img/sample13.jpg');
}
.cp_accordionslide03 .slideitem:nth-child(4) {
background-image: url('img/sample14.jpg');
}
.cp_accordionslide03 .slideitem:nth-child(5) {
background-image: url('img/sample15.jpg');
}
.cp_accordionslide03 .slideitem:after {
position: absolute;
z-index: 2;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
content: '';
opacity: 0;
background-color: rgba(57,73,171 ,0.6);
}
.cp_accordionslide03:hover .slideitem:hover {
width: 60%;
}
.cp_accordionslide03:hover .slideitem:not(:hover):after {
-webkit-transition: all 0.2s linear 0s;
transition: all 0.2s linear 0s;
opacity: 1;
}
.cp_accordionslide03 .slideitem .slidecont {
position: absolute;
z-index: 4;
bottom: 60px;
left: -60px;
visibility: hidden;
max-width: 400px;
padding: 20px;
color: #ffffff;
border-radius: 5px;
background-color: rgba(26,35,126 ,0.6);
}
.cp_accordionslide03 .slideitem .slidecont h2 {
font-size: 1.4em;
}
.cp_accordionslide03:hover .slideitem:hover .slidecont {
left: 30px;
visibility: visible;
-webkit-transition: all 0.3s cubic-bezier(0, 0, 0, 1.82) 0.5s;
transition: all 0.3s cubic-bezier(0, 0, 0, 1.82) 0.5s;
opacity: 1;
}
@media only screen and (max-width:768px) {
.cp_accordionslide03 {
height: 80vh;
}
.cp_accordionslide03 .slideitem .slidecont h2 {
font-size: 0.9em;
}
.cp_accordionslide03 .slideitem .slidecont p {
font-size: 0.7em;
}
.cp_accordionslide03 .slideitem .slidecont {
right: 10px;
bottom: 10px;
left: 10px;
}
.cp_accordionslide03:hover .slideitem:hover .slidecont {
left: 10px;
}
}

背景に画像を使ったホバーでテキストが回転しながら出てくるスライド

ニャン易度

Section 1

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 2

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 3

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 4

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 5

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

<div class="cp_accordionslide04">
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 1</h2>
<div class="text">
<p>テキスト 1</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 2</h2>
<div class="text">
<p>テキスト 2</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 3</h2>
<div class="text">
<p>テキスト 3</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 4</h2>
<div class="text">
<p>テキスト 4</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 5</h2>
<div class="text">
<p>テキスト 5</p>
</div>
</div>
</div>
</div>
.cp_accordionslide04 {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
visibility: hidden;
width: 100%;
height: 60vh;
}
.cp_accordionslide04 .slideitem {
position: relative;
visibility: visible;
overflow: hidden;
width: 20%;
height: 100%;
cursor: pointer;
-webkit-transition: all 0.3s linear 0s;
transition: all 0.3s linear 0s;
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}
.cp_accordionslide04 .slideitem:nth-child(1) {
background-image: url('img/sample6.jpg');
}
.cp_accordionslide04 .slideitem:nth-child(2) {
background-image: url('img/sample8.jpg');
}
.cp_accordionslide04 .slideitem:nth-child(3) {
background-image: url('img/sample10.jpg');
}
.cp_accordionslide04 .slideitem:nth-child(4) {
background-image: url('img/sample12.jpg');
}
.cp_accordionslide04 .slideitem:nth-child(5) {
background-image: url('img/sample14.jpg');
}
.cp_accordionslide04 .slideitem:after {
position: absolute;
z-index: 2;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
content: '';
-webkit-transform: scale(0.7);
transform: scale(0.7);
-webkit-transform-origin: center center;
transform-origin: center center;
opacity: 0;
background-color: rgba(0,96,100 ,0.3);
}
.cp_accordionslide04:hover .slideitem:hover {
width: 60%;
}
.cp_accordionslide04:hover .slideitem:hover:after {
visibility: visible;
-webkit-transition: all 0.2s linear 0.3s;
transition: all 0.2s linear 0.3s;
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1;
}
.cp_accordionslide04 .slideitem .slidecont {
position: absolute;
z-index: 4;
bottom: 60px;
left: 30px;
visibility: hidden;
max-width: 400px;
padding: 20px;
-webkit-transform: scale(0.7) rotate(-30deg);
transform: scale(0.7) rotate(-30deg);
color: #ffffff;
border-radius: 5px;
background-color: rgba(0,172,193 ,0.8);
}
.cp_accordionslide04 .slideitem .slidecont h2 {
font-size: 1.4em;
}
.cp_accordionslide04:hover .slideitem:hover .slidecont {
visibility: visible;
-webkit-transition: all 0.2s linear 0.6s;
transition: all 0.2s linear 0.6s;
-webkit-transform: scale(1) rotate(0deg);
transform: scale(1) rotate(0deg);
opacity: 1;
}
@media only screen and (max-width:768px) {
.cp_accordionslide04 {
height: 80vh;
}
.cp_accordionslide04 .slideitem .slidecont h2 {
font-size: 0.9em;
}
.cp_accordionslide04 .slideitem .slidecont p {
font-size: 0.7em;
}
.cp_accordionslide04 .slideitem .slidecont {
right: 10px;
bottom: 10px;
left: 10px;
}
.cp_accordionslide04:hover .slideitem:hover .slidecont {
left: 10px;
}
}

背景に画像を使ったホバーでテキストが手前から出てくるスライド

ニャン易度

Section 1

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 2

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 3

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 4

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 5

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

<div class="cp_accordionslide05">
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 1</h2>
<div class="text">
<p>テキスト 1</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 2</h2>
<div class="text">
<p>テキスト 2</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 3</h2>
<div class="text">
<p>テキスト 3</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 4</h2>
<div class="text">
<p>テキスト 4</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 5</h2>
<div class="text">
<p>テキスト 5</p>
</div>
</div>
</div>
</div>
.cp_accordionslide05 {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
visibility: hidden;
width: 100%;
height: 60vh;
}
.cp_accordionslide05 .slideitem {
position: relative;
visibility: visible;
overflow: hidden;
width: 20%;
height: 100%;
cursor: pointer;
-webkit-transition: all 0.3s linear 0s;
transition: all 0.3s linear 0s;
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}
.cp_accordionslide05 .slideitem:nth-child(1) {
background-image: url('img/sample7.jpg');
}
.cp_accordionslide05 .slideitem:nth-child(2) {
background-image: url('img/sample9.jpg');
}
.cp_accordionslide05 .slideitem:nth-child(3) {
background-image: url('img/sample11.jpg');
}
.cp_accordionslide05 .slideitem:nth-child(4) {
background-image: url('img/sample13.jpg');
}
.cp_accordionslide05 .slideitem:nth-child(5) {
background-image: url('img/sample15.jpg');
}
.cp_accordionslide05 .slideitem:after {
position: absolute;
z-index: 2;
top: -100%;
left: 0;
display: block;
width: 100%;
height: 100%;
content: '';
opacity: 0;
background-color: rgba(240,98,146 ,0.3);
}
.cp_accordionslide05:hover .slideitem:hover {
width: 60%;
}
.cp_accordionslide05:hover .slideitem:not(:hover):after {
top: 0;
visibility: visible;
-webkit-transition: all 0.2s linear 0s;
transition: all 0.2s linear 0s;
opacity: 1;
}
.cp_accordionslide05 .slideitem .slidecont {
position: absolute;
z-index: 4;
bottom: 60px;
left: 30px;
visibility: hidden;
max-width: 400px;
padding: 20px;
-webkit-transform: scale(1.2);
transform: scale(1.2);
color: #ffffff;
border-radius: 5px;
background-color: rgba(194,24,91 ,0.6);
}
.cp_accordionslide05 .slideitem .slidecont h2 {
font-size: 1.4em;
}
.cp_accordionslide05:hover .slideitem:hover .slidecont {
visibility: visible;
-webkit-transition: all 0.2s linear 0.3s;
transition: all 0.2s linear 0.3s;
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1;
}
@media only screen and (max-width:768px) {
.cp_accordionslide05 {
height: 80vh;
}
.cp_accordionslide05 .slideitem .slidecont h2 {
font-size: 0.9em;
}
.cp_accordionslide05 .slideitem .slidecont p {
font-size: 0.7em;
}
.cp_accordionslide05 .slideitem .slidecont {
right: 10px;
bottom: 10px;
left: 10px;
}
.cp_accordionslide05:hover .slideitem:hover .slidecont {
left: 10px;
}
}

背景に画像を使ったホバーでテキストが奥から出てくるスライド

ニャン易度

Section 1

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 2

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 3

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 4

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 5

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

<div class="cp_accordionslide06">
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 1</h2>
<div class="text">
<p>テキスト 1</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 2</h2>
<div class="text">
<p>テキスト 2</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 3</h2>
<div class="text">
<p>テキスト 3</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 4</h2>
<div class="text">
<p>テキスト 4</p>
</div>
</div>
</div>
<div class="slideitem">
<div class="slidecont">
<h2>タイトル 5</h2>
<div class="text">
<p>テキスト 5</p>
</div>
</div>
</div>
</div>
.cp_accordionslide06 {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
visibility: hidden;
width: 100%;
height: 60vh;
}
.cp_accordionslide06 .slideitem {
position: relative;
visibility: visible;
overflow: hidden;
width: 20%;
height: 100%;
cursor: pointer;
-webkit-transition: all 0.3s linear 0s;
transition: all 0.3s linear 0s;
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}
.cp_accordionslide06 .slideitem:nth-child(1) {
background-image: url('img/sample6.jpg');
}
.cp_accordionslide06 .slideitem:nth-child(2) {
background-image: url('img/sample7.jpg');
}
.cp_accordionslide06 .slideitem:nth-child(3) {
background-image: url('img/sample8.jpg');
}
.cp_accordionslide06 .slideitem:nth-child(4) {
background-image: url('img/sample9.jpg');
}
.cp_accordionslide06 .slideitem:nth-child(5) {
background-image: url('img/sample10.jpg');
}
.cp_accordionslide06 .slideitem:after {
position: absolute;
z-index: 2;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
content: '';
opacity: 0;
background-color: rgba(255,204,128 ,0.6);
}
.cp_accordionslide06:hover .slideitem:hover:after {
visibility: visible;
-webkit-transition: all 0.2s linear 0.4s;
transition: all 0.2s linear 0.4s;
opacity: 1;
}
.cp_accordionslide06:hover .slideitem:hover {
width: 60%;
}
.cp_accordionslide06 .slideitem .slidecont {
position: absolute;
z-index: 4;
bottom: 60px;
left: 30px;
visibility: hidden;
max-width: 400px;
padding: 20px;
-webkit-transform: scale(0.85);
transform: scale(0.85);
color: #ffffff;
border-radius: 5px;
background-color: rgba(239,108,0 ,0.6);
}
.cp_accordionslide06 .slideitem .slidecont h2 {
font-size: 1.4em;
}
.cp_accordionslide06:hover .slideitem:hover .slidecont {
visibility: visible;
-webkit-transition: all 0.2s linear 0.7s;
transition: all 0.2s linear 0.7s;
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1;
}
@media only screen and (max-width:768px) {
.cp_accordionslide06 {
height: 80vh;
}
.cp_accordionslide06 .slideitem .slidecont h2 {
font-size: 0.9em;
}
.cp_accordionslide06 .slideitem .slidecont p {
font-size: 0.7em;
}
.cp_accordionslide06 .slideitem .slidecont {
right: 10px;
bottom: 10px;
left: 10px;
}
.cp_accordionslide06:hover .slideitem:hover .slidecont {
left: 10px;
}
}

レスポンシブでタイトルが縦になるスライド

ニャン易度

Section 1

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 2

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 3

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 4

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 5

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

<div class="cp_accordionslide07">
<div class="slideitem">
<h2>タイトル 1</h2>
<div class="slidecont" title="タイトル 1">
<p>テキスト 1</p>
</div>
</div>
<div class="slideitem">
<h2>タイトル 2</h2>
<div class="slidecont" title="タイトル 2">
<p>テキスト 2</p>
</div>
</div>
<div class="slideitem">
<h2>タイトル 3</h2>
<div class="slidecont" title="タイトル 3">
<p>テキスト 3</p>
</div>
</div>
<div class="slideitem">
<h2>タイトル 4</h2>
<div class="slidecont" title="タイトル 4">
<p>テキスト 4</p>
</div>
</div>
<div class="slideitem">
<h2>タイトル 5</h2>
<div class="slidecont" title="タイトル 5">
<p>テキスト 5</p>
</div>
</div>
</div>
.cp_accordionslide07 {
position: relative;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
overflow: hidden;
height: 60vh;
}
.cp_accordionslide07 .slideitem {
position: relative;
z-index: 1;
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 20%;
padding: 2vh 1vw;
-webkit-transition: width 0.5s ease;
transition: width 0.5s ease;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
text-align: center;
vertical-align: bottom;
text-decoration: none;
color: #ffffff;
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}
.cp_accordionslide07 .slideitem:nth-child(1) {
background-image: url('img/sample11.jpg');
}
.cp_accordionslide07 .slideitem:nth-child(2) {
background-image: url('img/sample12.jpg');
}
.cp_accordionslide07 .slideitem:nth-child(3) {
background-image: url('img/sample13.jpg');
}
.cp_accordionslide07 .slideitem:nth-child(4) {
background-image: url('img/sample14.jpg');
}
.cp_accordionslide07 .slideitem:nth-child(5) {
background-image: url('img/sample15.jpg');
}
.cp_accordionslide07:hover .slideitem {
width: 10%;
}
.cp_accordionslide07 .slideitem:hover {
width: 60%;
}
.cp_accordionslide07 .slideitem::after {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
content: '';
-webkit-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
}
.cp_accordionslide07 .slideitem:hover::after {
z-index: 0;
background-color: rgba(3, 22, 37, 0.3);
}
.cp_accordionslide07 .slideitem .slidecont {
-webkit-transition: opacity 0.2s ease 0;
transition: opacity 0.2s ease 0;
opacity: 0;
}
.cp_accordionslide07 .slideitem:hover .slidecont {
-webkit-transition: opacity 0.3s ease 0.3s;
transition: opacity 0.3s ease 0.3s;
opacity: 1;
}
.cp_accordionslide07 .slideitem h2 {
font-size: 1.4em;
position: absolute;
z-index: 2;
bottom: 2vh;
width: 100%;
margin: 0;
text-align: center;
}
.cp_accordionslide07 .slideitem .slidecont {
position: relative;
z-index: 2;
width: 58vw;
text-align: left;
}
.cp_accordionslide07 .slideitem .slidecont p {
width: 40vw;
padding: 0.5vh 1vw 6vh;
}
@media only screen and (max-width:768px) {
.cp_accordionslide07 {
height: 80vh;
}
.cp_accordionslide07 .slideitem {
padding: 2vh 3vw;
}
.cp_accordionslide07 .slideitem h2 {
bottom: 25%;
min-width: 12em;
-webkit-transform: rotate(-90deg);
transform: rotate(-90deg);
-webkit-transform-origin: 0 0 0;
transform-origin: 0 0 0;
text-align: left;
opacity: 1;
}
.cp_accordionslide07 .slideitem:hover h2 {
opacity: 0;
}
.cp_accordionslide07 .slideitem .slidecont p {
width: 50vw;
}
.cp_accordionslide07 .slideitem .slidecont {
overflow-y: auto;
max-height: 100%;
}
.cp_accordionslide07 .slideitem:hover .slidecont::before {
font-size: 1.2em;
font-weight: bold;
display: block;
content: attr(title);
}
.cp_accordionslide07 .slideitem:hover {
width: 100% !important;
height: 100%;
}
}

レスポンシブで縦に開くスライド

ニャン易度

Section 1

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 2

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 3

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 4

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Section 5

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

<div class="cp_accordionslide08">
<div class="slideitem">
<h2>タイトル 1</h2>
<div class="slidecont">
<p>テキスト 1</p>
</div>
</div>
<div class="slideitem">
<h2>タイトル 2</h2>
<div class="slidecont">
<p>テキスト 2</p>
</div>
</div>
<div class="slideitem">
<h2>タイトル 3</h2>
<div class="slidecont">
<p>テキスト 3</p>
</div>
</div>
<div class="slideitem">
<h2>タイトル 4</h2>
<div class="slidecont">
<p>テキスト 4</p>
</div>
</div>
<div class="slideitem">
<h2>タイトル 5</h2>
<div class="slidecont">
<p>テキスト 5</p>
</div>
</div>
</div>
.cp_accordionslide08 {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
background-color: #031625;
}
.cp_accordionslide08:hover .slideitem {
width: 20%;
}
.cp_accordionslide08 .slideitem {
position: relative;
overflow: hidden;
width: 20%;
height: 60vh;
-webkit-transition: width 0.5s ease;
transition: width 0.5s ease;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
color: #ffffff;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
.cp_accordionslide08 .slideitem:nth-child(1) {
background-image: url('img/sample6.jpg');
}
.cp_accordionslide08 .slideitem:nth-child(2) {
background-image: url('img/sample8.jpg');
}
.cp_accordionslide08 .slideitem:nth-child(3) {
background-image: url('img/sample10.jpg');
}
.cp_accordionslide08 .slideitem:nth-child(4) {
background-image: url('img/sample12.jpg');
}
.cp_accordionslide08 .slideitem:nth-child(5) {
background-image: url('img/sample14.jpg');
}
.cp_accordionslide08 .slideitem:before,
.cp_accordionslide08 .slideitem:after {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
content: '';
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.cp_accordionslide08 .slideitem:after {
-webkit-transition: opacity 0.5s ease;
transition: opacity 0.5s ease;
opacity: 1;
background: rgba(3, 22, 37, 0.85);
}
.cp_accordionslide08 .slideitem:before {
z-index: 1;
-webkit-transition: opacity 0.5s ease, -webkit-transform 0.5s ease;
transition: opacity 0.5s ease, -webkit-transform 0.5s ease;
transition: opacity 0.5s ease, transform 0.5s ease;
transition: opacity 0.5s ease, transform 0.5s ease, -webkit-transform 0.5s ease;
-webkit-transform: translate3d(0, 0, 0) translateY(50%);
transform: translate3d(0, 0, 0) translateY(50%);
opacity: 0;
background: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), color-stop(75%, #000000));
background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%, #000000 75%);
background:         linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, #000000 75%);
}
.cp_accordionslide08 .slideitem:hover {
width: 60% !important;
}
.cp_accordionslide08 .slideitem:hover:after {
opacity: 0;
}
.cp_accordionslide08 .slideitem:hover:before {
-webkit-transition: opacity 1s ease, -webkit-transform 1s ease 0.25s;
transition: opacity 1s ease, -webkit-transform 1s ease 0.25s;
transition: opacity 1s ease, transform 1s ease 0.25s;
transition: opacity 1s ease, transform 1s ease 0.25s, -webkit-transform 1s ease 0.25s;
-webkit-transform: translate3d(0, 0, 0) translateY(0);
transform: translate3d(0, 0, 0) translateY(0);
opacity: 1;
}
.cp_accordionslide08 .slideitem:hover .slidecont {
-webkit-transition: all 0.75s ease 0.5s;
transition: all 0.75s ease 0.5s;
-webkit-transform: translateY(0);
transform: translateY(0);
opacity: 1;
}
.cp_accordionslide08 .slideitem h2 {
font-size: 1.4em;
position: absolute;
z-index: 1;
top: 50%;
left: 50%;
-webkit-transition: all 0.75s ease;
transition: all 0.75s ease;
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
white-space: nowrap;
}
.cp_accordionslide08 .slideitem h2::before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
content: '';
}
.cp_accordionslide08 .slideitem:hover h2 {
top: 2%;
}
.cp_accordionslide08 .slidecont {
position: relative;
z-index: 1;
top: 10%;
margin: 0 1.618em;
-webkit-transform: translate3d(0, 0, 0) translateY(25px);
transform: translate3d(0, 0, 0) translateY(25px);
text-align: center;
opacity: 0;
}
@media only screen and (max-width:768px) {
.cp_accordionslide08 {
display: block;
}
.cp_accordionslide08:hover .slideitem {
width: 100%;
height: 20vh;
}
.cp_accordionslide08 .slideitem {
width: 100%;
height: 20vh;
}
.cp_accordionslide08 .slideitem:hover {
width: 100% !important;
height: 100vh !important;
}
.cp_accordionslide08 .slideitem h2 {
top: 35%;
}
}

copypet.jp

CSS3などで新たに追加された要素・装飾方法など、日々コードを書いていないと忘れてしまったり、ささっとプロトタイプを作る時などちょっとしたことに時間をかけている暇はない。そんな時に「あ〜、あれストックしときゃよかったなぁ」って困った自分用のストックブログです。カスタマイズなどがしやすいよう、昨今のweb制作に取り入れられる一般的なコードを中心に掲載しています。

More Info

こんな記事はいかがですか?