質問編集履歴
1
codepenの外部リンクを削除するにあたり、こちらのページに問題のあったソースを記述しておきます。
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -17,12 +17,291 @@
|
|
|
17
17
|
|
|
18
18
|
以下、現在制作しているアコーディオンのhtmlとcssになります。
|
|
19
19
|
|
|
20
|
-
**◾️codepen**
|
|
21
|
-
https://codepen.io/UUTUM/pen/JjdmYBO
|
|
22
|
-
|
|
23
20
|
※codepen上では画像は外に飛び出してしまいますが、wordpress上では
|
|
24
21
|
きちんとアコーディオン内に格納されています。
|
|
25
22
|
この原因もご存知であればお教えいただきたいです。
|
|
26
23
|
|
|
27
24
|
お手数ですが、ご確認の上、ご回答いただけましたら幸いです。
|
|
28
|
-
何卒よろしくお願い致します。
|
|
25
|
+
何卒よろしくお願い致します。
|
|
26
|
+
|
|
27
|
+
```HTML
|
|
28
|
+
<!---------------------------------------------------------------------->
|
|
29
|
+
|
|
30
|
+
<div class="container">
|
|
31
|
+
<div class="row hello_box">
|
|
32
|
+
<ul>
|
|
33
|
+
<li>
|
|
34
|
+
<input type="checkbox" checked>
|
|
35
|
+
<i></i>
|
|
36
|
+
<h2 class="accordion">Q:質問1(問題:テキストと画像の2カラムで
|
|
37
|
+
表示したいです。)</h2>
|
|
38
|
+
<p class="accordion">
|
|
39
|
+
テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。
|
|
40
|
+
</p>
|
|
41
|
+
<img class="pc accordion" src="/images/test_pc-01.jpg" width="300px" height="300px" alt="パソコン用の画像"/>
|
|
42
|
+
<img class="sp accordion" src="/images/track_sp.svg" alt="スマートフォン用の画像"/>
|
|
43
|
+
</li>
|
|
44
|
+
|
|
45
|
+
<li>
|
|
46
|
+
<input type="checkbox" checked>
|
|
47
|
+
<i></i>
|
|
48
|
+
<h2 class="accordion">Q:質問2(テキストは上で下に画像を3点1カラムで表示したいです。)</h2>
|
|
49
|
+
<p class="accordion">テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。 </p><img class="pc accordion" src="/images/test_pc-01.jpg" width="300px" height="300px" alt="パソコン用の画像"/><img class="sp accordion" src="/images/track_sp.svg" alt="スマートフォン用の画像"/>
|
|
50
|
+
</li>
|
|
51
|
+
<li>
|
|
52
|
+
<input type="checkbox" checked>
|
|
53
|
+
<i></i>
|
|
54
|
+
<h2 class="accordion">質問3</h2>
|
|
55
|
+
<p class="accordion">テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。 </p>
|
|
56
|
+
<img src="/images/idea-100.jpg" class="accordion" alt="" class="aligncenter"
|
|
57
|
+
width="300" height="300" border="0" />
|
|
58
|
+
</li>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
/*===============================================
|
|
67
|
+
* アコーディオン
|
|
68
|
+
*==============================================*/
|
|
69
|
+
|
|
70
|
+
.transition, p, ul li i:before, ul li i:after {
|
|
71
|
+
-webkit-transition: all 0.25s ease-in-out;
|
|
72
|
+
transition: all 0.25s ease-in-out;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.flipIn, h1, ul li {
|
|
76
|
+
-webkit-animation: flipdown 0.5s ease both;
|
|
77
|
+
animation: flipdown 0.5s ease both;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.no-select, h2 {
|
|
81
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
82
|
+
-webkit-touch-callout: none;
|
|
83
|
+
-webkit-user-select: none;
|
|
84
|
+
-moz-user-select: none;
|
|
85
|
+
-ms-user-select: none;
|
|
86
|
+
user-select: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
h2.accordion{
|
|
91
|
+
/*文字の大きさ*/
|
|
92
|
+
font-size: 16px;
|
|
93
|
+
/*行間の幅*/
|
|
94
|
+
line-height: 34px;
|
|
95
|
+
/*文字の太さ*/
|
|
96
|
+
font-weight: 300;
|
|
97
|
+
/*文字の間隔の調節*/
|
|
98
|
+
letter-spacing: 1px;
|
|
99
|
+
/*ーーー*/
|
|
100
|
+
display: block;
|
|
101
|
+
/*要素外の幅*/
|
|
102
|
+
margin-right:50px;
|
|
103
|
+
/*変更ー元の数値は0*/
|
|
104
|
+
padding:0px 0px 0px 0px;
|
|
105
|
+
/*カーソルをポインターに変更*/
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
}
|
|
108
|
+
/*h2にmarginを追加してもなぜか反映されない*/
|
|
109
|
+
|
|
110
|
+
p.accordion{
|
|
111
|
+
color: rgba(48, 69, 92, 0.8);
|
|
112
|
+
font-size: 14px;
|
|
113
|
+
line-height: 26px;
|
|
114
|
+
letter-spacing: 1px;
|
|
115
|
+
position: relative;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
/*追加-下の要素が飛び出るので 元は800px*/
|
|
118
|
+
max-height: 1000px;
|
|
119
|
+
opacity: 1;
|
|
120
|
+
-webkit-transform: translate(0, 0);
|
|
121
|
+
-ms-transform: translate(0, 0);
|
|
122
|
+
transform: translate(0, 0);
|
|
123
|
+
/*変更ーpadding:30px 50px;*/
|
|
124
|
+
padding:0px 30px 50px 0px;
|
|
125
|
+
/*要素外の幅*/
|
|
126
|
+
margin-right:50px;
|
|
127
|
+
z-index: 2;
|
|
128
|
+
/*右側に要素を配置*/
|
|
129
|
+
float:right;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/*変更:margin-top: 14px;*/
|
|
133
|
+
img src.accordion{
|
|
134
|
+
margin-top: 0px;
|
|
135
|
+
padding:0 0 50px 50px;
|
|
136
|
+
float:left;
|
|
137
|
+
}
|
|
138
|
+
/*変更:margin-top: 14px;*/
|
|
139
|
+
img src.accordion_noimage{
|
|
140
|
+
margin-top: 0px;
|
|
141
|
+
padding:30px 50px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
ul {
|
|
145
|
+
list-style: none;
|
|
146
|
+
-webkit-perspective: 900;
|
|
147
|
+
perspective: 900;
|
|
148
|
+
padding: 0;
|
|
149
|
+
margin: 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
ul li {
|
|
153
|
+
position: relative;
|
|
154
|
+
padding: 0;
|
|
155
|
+
margin: 0;
|
|
156
|
+
/*変更: padding-bottom: 4px;*/
|
|
157
|
+
padding-bottom: 0px;
|
|
158
|
+
/*変更:padding-top: 18px;*/
|
|
159
|
+
padding-top: 0px;
|
|
160
|
+
/*ボーダーの色→border-top: 1px dotted #dce7eb;*/
|
|
161
|
+
border-top: 1px dotted #555555;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
ul li:nth-of-type(1) {
|
|
165
|
+
-webkit-animation-delay: 0.5s;
|
|
166
|
+
animation-delay: 0.5s;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
ul li:nth-of-type(2) {
|
|
170
|
+
-webkit-animation-delay: 0.75s;
|
|
171
|
+
animation-delay: 0.75s;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
ul li:nth-of-type(3) {
|
|
175
|
+
-webkit-animation-delay: 1.0s;
|
|
176
|
+
animation-delay: 1.0s;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
ul li:last-of-type {
|
|
180
|
+
padding-bottom: 0;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
/*<<<アコーディオンのアロー>>>*/
|
|
186
|
+
ul li i {
|
|
187
|
+
position: absolute;
|
|
188
|
+
-webkit-transform: translate(-6px, 0);
|
|
189
|
+
-ms-transform: translate(-6px, 0);
|
|
190
|
+
transform: translate(-6px, 0);
|
|
191
|
+
margin-top: 30px;
|
|
192
|
+
/*右からのオブジェクトの位置を決める*/
|
|
193
|
+
right: 30px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
ul li i:before, ul li i:after {
|
|
197
|
+
content: "";
|
|
198
|
+
position: absolute;
|
|
199
|
+
background-color: #ff6873;
|
|
200
|
+
width: 3px;
|
|
201
|
+
height: 9px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
ul li i:before {
|
|
205
|
+
-webkit-transform: translate(-2px, 0) rotate(45deg);
|
|
206
|
+
-ms-transform: translate(-2px, 0) rotate(45deg);
|
|
207
|
+
transform: translate(-2px, 0) rotate(45deg);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
ul li i:after {
|
|
211
|
+
-webkit-transform: translate(2px, 0) rotate(-45deg);
|
|
212
|
+
-ms-transform: translate(2px, 0) rotate(-45deg);
|
|
213
|
+
transform: translate(2px, 0) rotate(-45deg);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
ul li input[type=checkbox] {
|
|
217
|
+
position: absolute;
|
|
218
|
+
cursor: pointer;
|
|
219
|
+
width: 100%;
|
|
220
|
+
height: 100%;
|
|
221
|
+
z-index: 1;
|
|
222
|
+
opacity: 0;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
ul li input[type=checkbox]:checked ~ p {
|
|
226
|
+
margin-top: 0;
|
|
227
|
+
max-height: 0;
|
|
228
|
+
opacity: 0;
|
|
229
|
+
-webkit-transform: translate(0, 50%);
|
|
230
|
+
-ms-transform: translate(0, 50%);
|
|
231
|
+
transform: translate(0, 50%);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
ul li input[type=checkbox]:checked ~ i:before {
|
|
235
|
+
-webkit-transform: translate(2px, 0) rotate(45deg);
|
|
236
|
+
-ms-transform: translate(2px, 0) rotate(45deg);
|
|
237
|
+
transform: translate(2px, 0) rotate(45deg);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
ul li input[type=checkbox]:checked ~ i:after {
|
|
241
|
+
-webkit-transform: translate(-2px, 0) rotate(-45deg);
|
|
242
|
+
-ms-transform: translate(-2px, 0) rotate(-45deg);
|
|
243
|
+
transform: translate(-2px, 0) rotate(-45deg);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@-webkit-keyframes flipdown {
|
|
247
|
+
0% {
|
|
248
|
+
opacity: 0;
|
|
249
|
+
-webkit-transform-origin: top center;
|
|
250
|
+
transform-origin: top center;
|
|
251
|
+
-webkit-transform: rotateX(-90deg);
|
|
252
|
+
transform: rotateX(-90deg);
|
|
253
|
+
}
|
|
254
|
+
5% {
|
|
255
|
+
opacity: 1;
|
|
256
|
+
}
|
|
257
|
+
80% {
|
|
258
|
+
-webkit-transform: rotateX(8deg);
|
|
259
|
+
transform: rotateX(8deg);
|
|
260
|
+
}
|
|
261
|
+
83% {
|
|
262
|
+
-webkit-transform: rotateX(6deg);
|
|
263
|
+
transform: rotateX(6deg);
|
|
264
|
+
}
|
|
265
|
+
92% {
|
|
266
|
+
-webkit-transform: rotateX(-3deg);
|
|
267
|
+
transform: rotateX(-3deg);
|
|
268
|
+
}
|
|
269
|
+
100% {
|
|
270
|
+
-webkit-transform-origin: top center;
|
|
271
|
+
transform-origin: top center;
|
|
272
|
+
-webkit-transform: rotateX(0deg);
|
|
273
|
+
transform: rotateX(0deg);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
@keyframes flipdown {
|
|
278
|
+
0% {
|
|
279
|
+
opacity: 0;
|
|
280
|
+
-webkit-transform-origin: top center;
|
|
281
|
+
transform-origin: top center;
|
|
282
|
+
-webkit-transform: rotateX(-90deg);
|
|
283
|
+
transform: rotateX(-90deg);
|
|
284
|
+
}
|
|
285
|
+
5% {
|
|
286
|
+
opacity: 1;
|
|
287
|
+
}
|
|
288
|
+
80% {
|
|
289
|
+
-webkit-transform: rotateX(8deg);
|
|
290
|
+
transform: rotateX(8deg);
|
|
291
|
+
}
|
|
292
|
+
83% {
|
|
293
|
+
-webkit-transform: rotateX(6deg);
|
|
294
|
+
transform: rotateX(6deg);
|
|
295
|
+
}
|
|
296
|
+
92% {
|
|
297
|
+
-webkit-transform: rotateX(-3deg);
|
|
298
|
+
transform: rotateX(-3deg);
|
|
299
|
+
}
|
|
300
|
+
100% {
|
|
301
|
+
-webkit-transform-origin: top center;
|
|
302
|
+
transform-origin: top center;
|
|
303
|
+
-webkit-transform: rotateX(0deg);
|
|
304
|
+
transform: rotateX(0deg);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
```
|