- .htaccess
- 404エラー
- All-in-One WP Migration
- API Key
- background
- Bootstrap4
- border
- Canonet
- Contact Form 7
- Contact Form7
- css
- Easy FancyBox
- fixed
- flex
- font
- Font−family
- googlemap
- header.php
- Intuitive Custom Post Order
- Lightbox
- MW WP Form
- ol
- PHP
- reCAPTCHA
- SSL
- SVG
- text-shadow
- the_content
- wordpress削除
- youtube
- アイキャッチ
- アコーディオン
- アコーディオンメニュー
- アニメーション
- アンカーリンク
- エックスドメイン
- エディター
- エフェクト
- カスタムフィールド
- カテゴリー
- カラー
- カレント
- かんたんインストール
- サーバー移行
- さくらのレンタルサーバー
- スクロール
- スパムメール
- スムーススクロール
- タグ
- ツイッター
- データベース
- ドメイン
- ドメイン移管
- トリミング
- ドロップダウン
- にゅるっと
- ネームサーバー
- パーミッション
- パスワード保護
- バックアップ
- ハンバーガー
- ハンバーガーメニュー
- ファイルサイズ
- フォント
- プレビュー
- マウスオーバー
- ムームー
- ラベル
- リスト
- リスト横並び
- リダイレクト
- レスポンシブ
- ローディング
- ロリポップ
- 並び替え
- 名刺
- 固定ページ
- 投稿記事
- 投稿詳細ページ
- 擬似クラス
- 文字制限
- 条件分岐
- 無料のレンタルサーバー
- 背景画像
- 記事一覧
- 記事一覧ページ
- 記事詳細ページ
1 |
/* Your code... */</code> <div class="innnerBox"> <div class="accordion"> <div class="accordion-container"> <!-- 1 --> <div class="accordion-item"> <h3 class="accordion-title js-accordion-title"> アコーディオンタイトル1 </h3> <div class="accordion-content"> <p>コンテンツが入ります。</p> </div> </div> <!-- 2 --> <div class="accordion-item"> <h3 class="accordion-title js-accordion-title"> アコーディオンタイトル2 </h3> <div class="accordion-content"> <p>コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。</p> </div> </div> <!-- 3 --> <div class="accordion-item"> <h3 class="accordion-title js-accordion-title"> アコーディオンタイトル3 </h3> <div class="accordion-content"> <p>コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。</p> </div> </div> <!-- 4 --> <div class="accordion-item"> <h3 class="accordion-title js-accordion-title"> アコーディオンタイトル4 </h3> <div class="accordion-content"> <p>コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。コンテンツが入ります。</p> </div> </div> </div><!-- /.accordion-container --> </div><!-- /.accordion --> </div> |
1 |
.accordion-item {
margin-bottom: 40px;
background-color: #fcf3f0;
border-radius: .6em;
}
.accordion {
margin-left: auto;
margin-right: auto;
margin-top: 30px;
position: relative;
width: 100%;
}
1 |
1 |
.accordion-title {
cursor: pointer;
font-weight: 600;
padding: 30px 80px 30px 100px;
margin-bottom: 0;
font-size: 1.6rem;
}
1 |
.accordion-title::before {
display: block;
content: “Q”;
font-family: ‘Archivo’, sans-serif;
background: #f78216;
color: #fff;
text-align: center;
width: 40px;
height: 40px;
line-height: 40px;
border-radius: 50%;
font-size: 2.0rem;
position: absolute;
top: 27px;
left: 40px;
}
1 |
.accordion-content {
display: none;
padding: 15px 80px 40px 100px;
}
1 |
.accordion-content p::before {
display: block;
content: “A”;
font-family: ‘Archivo’, sans-serif;
background: #003f7e;
color: #fff;
text-align: center;
width: 40px;
height: 40px;
line-height: 40px;
border-radius: 50%;
font-size: 2.0rem;
position: absolute;
top: 0px;
left: -60px;
}
1 |
.accordion-content p {
position: relative;
margin-bottom: 0;
font-size: 1.3rem;
}
1 |
/* 矢印 */
.accordion-title {
position: relative;
}
1 |
.accordion-title::after {
border-right: solid 4px #f78216;
border-top: solid 4px #f78216;
content: “”;
display: block;
height: 16px;
position: absolute;
right: 40px;
top: 38%;
transform: rotate(135deg);
transition: transform .3s ease-in-out, top .3s ease-in-out;
width: 16px;
}
1 |
.accordion-title.open::after {
top: 45%;
transform: rotate(-45deg);
}
1 |
@media(min-width:768px) {
.accordion-title {
font-size: 1.6rem;
}
1 |
.accordion-content p {
font-size: 1.3rem;
}
}
1 |
@media(min-width:1024px) {
.accordion-title {
font-size: 1.8rem;
}
1 |
.accordion-content p {
font-size: 1.5rem;
}
}
1 |
@media(min-width:1366px) {
.accordion-title {
font-size: 2.2rem;
}
1 |
.accordion-content p {
font-size: 1.8rem;
}
}
1 |
@media only screen and (max-width: 428px) {
1 |
.accordion-title {
padding: 30px 40px 30px 50px;
font-size: 1.5rem;
}
1 |
.accordion-title::before {
width: 30px;
height: 30px;
line-height: 30px;
font-size: 1.8rem;
top: 27px;
left: 10px;
}
1 |
.accordion-content {
padding: 15px 20px 40px 50px;
}
1 |
.accordion-content p::before {
width: 30px;
height: 30px;
line-height: 30px;
font-size: 1.8rem;
top: 0px;
left: -40px;
}
1 |
.accordion-content p {
font-size: 1.3rem;
}
1 |
/* 矢印 */
.accordion-title::after {
border-right: solid 4px #f78216;
border-top: solid 4px #f78216;
content: “”;
display: block;
height: 16px;
position: absolute;
right: 15px;
top: 38%;
transform: rotate(135deg);
transition: transform .3s ease-in-out, top .3s ease-in-out;
width: 16px;
}
}
1 |
1 |
1 2 3 4 5 6 7 8 9 10 11 |
<script> $(function() { // タイトルをクリックすると $(".js-accordion-title").on("click", function() { // クリックした次の要素を開閉 $(this).next().slideToggle(300); // タイトルにopenクラスを付け外しして矢印の向きを変更 $(this).toggleClass("open", 300); }); }); </script> |