質問編集履歴

1

codepenの外部リンクを削除するにあたり、こちらのページに問題のあったソースを記述しておきます。

2020/03/31 23:45

投稿

UUTUM
UUTUM

スコア9

test CHANGED
File without changes
test CHANGED
@@ -36,12 +36,6 @@
36
36
 
37
37
 
38
38
 
39
- **◾️codepen**
40
-
41
- https://codepen.io/UUTUM/pen/JjdmYBO
42
-
43
-
44
-
45
39
  ※codepen上では画像は外に飛び出してしまいますが、wordpress上では
46
40
 
47
41
  きちんとアコーディオン内に格納されています。
@@ -53,3 +47,567 @@
53
47
  お手数ですが、ご確認の上、ご回答いただけましたら幸いです。
54
48
 
55
49
  何卒よろしくお願い致します。
50
+
51
+
52
+
53
+ ```HTML
54
+
55
+ <!---------------------------------------------------------------------->
56
+
57
+
58
+
59
+ <div class="container">
60
+
61
+ <div class="row hello_box">
62
+
63
+ <ul>
64
+
65
+ <li>
66
+
67
+ <input type="checkbox" checked>
68
+
69
+ <i></i>
70
+
71
+ <h2 class="accordion">Q:質問1(問題:テキストと画像の2カラムで
72
+
73
+ 表示したいです。)</h2>
74
+
75
+ <p class="accordion">
76
+
77
+ テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。
78
+
79
+ </p>
80
+
81
+ <img class="pc accordion" src="/images/test_pc-01.jpg" width="300px" height="300px" alt="パソコン用の画像"/>
82
+
83
+ <img class="sp accordion" src="/images/track_sp.svg" alt="スマートフォン用の画像"/>
84
+
85
+ </li>
86
+
87
+
88
+
89
+ <li>
90
+
91
+ <input type="checkbox" checked>
92
+
93
+ <i></i>
94
+
95
+ <h2 class="accordion">Q:質問2(テキストは上で下に画像を3点1カラムで表示したいです。)</h2>
96
+
97
+ <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="スマートフォン用の画像"/>
98
+
99
+ </li>
100
+
101
+ <li>
102
+
103
+ <input type="checkbox" checked>
104
+
105
+ <i></i>
106
+
107
+ <h2 class="accordion">質問3</h2>
108
+
109
+ <p class="accordion">テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。 テキストはダミーです。テキストはダミーです。 </p>
110
+
111
+ <img src="/images/idea-100.jpg" class="accordion" alt="" class="aligncenter"
112
+
113
+ width="300" height="300" border="0" />
114
+
115
+ </li>
116
+
117
+
118
+
119
+ </div>
120
+
121
+ </div>
122
+
123
+ ```
124
+
125
+
126
+
127
+
128
+
129
+ ```css
130
+
131
+ /*===============================================
132
+
133
+ *  アコーディオン
134
+
135
+ *==============================================*/
136
+
137
+
138
+
139
+ .transition, p, ul li i:before, ul li i:after {
140
+
141
+ -webkit-transition: all 0.25s ease-in-out;
142
+
143
+ transition: all 0.25s ease-in-out;
144
+
145
+ }
146
+
147
+
148
+
149
+ .flipIn, h1, ul li {
150
+
151
+ -webkit-animation: flipdown 0.5s ease both;
152
+
153
+ animation: flipdown 0.5s ease both;
154
+
155
+ }
156
+
157
+
158
+
159
+ .no-select, h2 {
160
+
161
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
162
+
163
+ -webkit-touch-callout: none;
164
+
165
+ -webkit-user-select: none;
166
+
167
+ -moz-user-select: none;
168
+
169
+ -ms-user-select: none;
170
+
171
+ user-select: none;
172
+
173
+ }
174
+
175
+
176
+
177
+
178
+
179
+ h2.accordion{
180
+
181
+ /*文字の大きさ*/
182
+
183
+ font-size: 16px;
184
+
185
+ /*行間の幅*/
186
+
187
+ line-height: 34px;
188
+
189
+ /*文字の太さ*/
190
+
191
+ font-weight: 300;
192
+
193
+ /*文字の間隔の調節*/
194
+
195
+ letter-spacing: 1px;
196
+
197
+ /*ーーー*/
198
+
199
+ display: block;
200
+
201
+ /*要素外の幅*/
202
+
203
+ margin-right:50px;
204
+
205
+ /*変更ー元の数値は0*/
206
+
207
+ padding:0px 0px 0px 0px;
208
+
209
+ /*カーソルをポインターに変更*/
210
+
211
+ cursor: pointer;
212
+
213
+ }
214
+
215
+ /*h2にmarginを追加してもなぜか反映されない*/
216
+
217
+
218
+
219
+ p.accordion{
220
+
221
+ color: rgba(48, 69, 92, 0.8);
222
+
223
+ font-size: 14px;
224
+
225
+ line-height: 26px;
226
+
227
+ letter-spacing: 1px;
228
+
229
+ position: relative;
230
+
231
+ overflow: hidden;
232
+
233
+ /*追加-下の要素が飛び出るので 元は800px*/
234
+
235
+ max-height: 1000px;
236
+
237
+ opacity: 1;
238
+
239
+ -webkit-transform: translate(0, 0);
240
+
241
+ -ms-transform: translate(0, 0);
242
+
243
+ transform: translate(0, 0);
244
+
245
+ /*変更ーpadding:30px 50px;*/
246
+
247
+ padding:0px 30px 50px 0px;
248
+
249
+ /*要素外の幅*/
250
+
251
+ margin-right:50px;
252
+
253
+ z-index: 2;
254
+
255
+ /*右側に要素を配置*/
256
+
257
+ float:right;
258
+
259
+ }
260
+
261
+
262
+
263
+ /*変更:margin-top: 14px;*/
264
+
265
+ img src.accordion{
266
+
267
+ margin-top: 0px;
268
+
269
+ padding:0 0 50px 50px;
270
+
271
+ float:left;
272
+
273
+ }
274
+
275
+ /*変更:margin-top: 14px;*/
276
+
277
+ img src.accordion_noimage{
278
+
279
+ margin-top: 0px;
280
+
281
+ padding:30px 50px;
282
+
283
+ }
284
+
285
+
286
+
287
+ ul {
288
+
289
+ list-style: none;
290
+
291
+ -webkit-perspective: 900;
292
+
293
+ perspective: 900;
294
+
295
+ padding: 0;
296
+
297
+ margin: 0;
298
+
299
+ }
300
+
301
+
302
+
303
+ ul li {
304
+
305
+ position: relative;
306
+
307
+ padding: 0;
308
+
309
+ margin: 0;
310
+
311
+ /*変更: padding-bottom: 4px;*/
312
+
313
+ padding-bottom: 0px;
314
+
315
+ /*変更:padding-top: 18px;*/
316
+
317
+ padding-top: 0px;
318
+
319
+ /*ボーダーの色→border-top: 1px dotted #dce7eb;*/
320
+
321
+ border-top: 1px dotted #555555;
322
+
323
+ }
324
+
325
+
326
+
327
+ ul li:nth-of-type(1) {
328
+
329
+ -webkit-animation-delay: 0.5s;
330
+
331
+ animation-delay: 0.5s;
332
+
333
+ }
334
+
335
+
336
+
337
+ ul li:nth-of-type(2) {
338
+
339
+ -webkit-animation-delay: 0.75s;
340
+
341
+ animation-delay: 0.75s;
342
+
343
+ }
344
+
345
+
346
+
347
+ ul li:nth-of-type(3) {
348
+
349
+ -webkit-animation-delay: 1.0s;
350
+
351
+ animation-delay: 1.0s;
352
+
353
+ }
354
+
355
+
356
+
357
+ ul li:last-of-type {
358
+
359
+ padding-bottom: 0;
360
+
361
+ }
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+ /*<<<アコーディオンのアロー>>>*/
370
+
371
+ ul li i {
372
+
373
+ position: absolute;
374
+
375
+ -webkit-transform: translate(-6px, 0);
376
+
377
+ -ms-transform: translate(-6px, 0);
378
+
379
+ transform: translate(-6px, 0);
380
+
381
+ margin-top: 30px;
382
+
383
+ /*右からのオブジェクトの位置を決める*/
384
+
385
+ right: 30px;
386
+
387
+ }
388
+
389
+
390
+
391
+ ul li i:before, ul li i:after {
392
+
393
+ content: "";
394
+
395
+ position: absolute;
396
+
397
+ background-color: #ff6873;
398
+
399
+ width: 3px;
400
+
401
+ height: 9px;
402
+
403
+ }
404
+
405
+
406
+
407
+ ul li i:before {
408
+
409
+ -webkit-transform: translate(-2px, 0) rotate(45deg);
410
+
411
+ -ms-transform: translate(-2px, 0) rotate(45deg);
412
+
413
+ transform: translate(-2px, 0) rotate(45deg);
414
+
415
+ }
416
+
417
+
418
+
419
+ ul li i:after {
420
+
421
+ -webkit-transform: translate(2px, 0) rotate(-45deg);
422
+
423
+ -ms-transform: translate(2px, 0) rotate(-45deg);
424
+
425
+ transform: translate(2px, 0) rotate(-45deg);
426
+
427
+ }
428
+
429
+
430
+
431
+ ul li input[type=checkbox] {
432
+
433
+ position: absolute;
434
+
435
+ cursor: pointer;
436
+
437
+ width: 100%;
438
+
439
+ height: 100%;
440
+
441
+ z-index: 1;
442
+
443
+ opacity: 0;
444
+
445
+ }
446
+
447
+
448
+
449
+ ul li input[type=checkbox]:checked ~ p {
450
+
451
+ margin-top: 0;
452
+
453
+ max-height: 0;
454
+
455
+ opacity: 0;
456
+
457
+ -webkit-transform: translate(0, 50%);
458
+
459
+ -ms-transform: translate(0, 50%);
460
+
461
+ transform: translate(0, 50%);
462
+
463
+ }
464
+
465
+
466
+
467
+ ul li input[type=checkbox]:checked ~ i:before {
468
+
469
+ -webkit-transform: translate(2px, 0) rotate(45deg);
470
+
471
+ -ms-transform: translate(2px, 0) rotate(45deg);
472
+
473
+ transform: translate(2px, 0) rotate(45deg);
474
+
475
+ }
476
+
477
+
478
+
479
+ ul li input[type=checkbox]:checked ~ i:after {
480
+
481
+ -webkit-transform: translate(-2px, 0) rotate(-45deg);
482
+
483
+ -ms-transform: translate(-2px, 0) rotate(-45deg);
484
+
485
+ transform: translate(-2px, 0) rotate(-45deg);
486
+
487
+ }
488
+
489
+
490
+
491
+ @-webkit-keyframes flipdown {
492
+
493
+ 0% {
494
+
495
+ opacity: 0;
496
+
497
+ -webkit-transform-origin: top center;
498
+
499
+ transform-origin: top center;
500
+
501
+ -webkit-transform: rotateX(-90deg);
502
+
503
+ transform: rotateX(-90deg);
504
+
505
+ }
506
+
507
+ 5% {
508
+
509
+ opacity: 1;
510
+
511
+ }
512
+
513
+ 80% {
514
+
515
+ -webkit-transform: rotateX(8deg);
516
+
517
+ transform: rotateX(8deg);
518
+
519
+ }
520
+
521
+ 83% {
522
+
523
+ -webkit-transform: rotateX(6deg);
524
+
525
+ transform: rotateX(6deg);
526
+
527
+ }
528
+
529
+ 92% {
530
+
531
+ -webkit-transform: rotateX(-3deg);
532
+
533
+ transform: rotateX(-3deg);
534
+
535
+ }
536
+
537
+ 100% {
538
+
539
+ -webkit-transform-origin: top center;
540
+
541
+ transform-origin: top center;
542
+
543
+ -webkit-transform: rotateX(0deg);
544
+
545
+ transform: rotateX(0deg);
546
+
547
+ }
548
+
549
+ }
550
+
551
+
552
+
553
+ @keyframes flipdown {
554
+
555
+ 0% {
556
+
557
+ opacity: 0;
558
+
559
+ -webkit-transform-origin: top center;
560
+
561
+ transform-origin: top center;
562
+
563
+ -webkit-transform: rotateX(-90deg);
564
+
565
+ transform: rotateX(-90deg);
566
+
567
+ }
568
+
569
+ 5% {
570
+
571
+ opacity: 1;
572
+
573
+ }
574
+
575
+ 80% {
576
+
577
+ -webkit-transform: rotateX(8deg);
578
+
579
+ transform: rotateX(8deg);
580
+
581
+ }
582
+
583
+ 83% {
584
+
585
+ -webkit-transform: rotateX(6deg);
586
+
587
+ transform: rotateX(6deg);
588
+
589
+ }
590
+
591
+ 92% {
592
+
593
+ -webkit-transform: rotateX(-3deg);
594
+
595
+ transform: rotateX(-3deg);
596
+
597
+ }
598
+
599
+ 100% {
600
+
601
+ -webkit-transform-origin: top center;
602
+
603
+ transform-origin: top center;
604
+
605
+ -webkit-transform: rotateX(0deg);
606
+
607
+ transform: rotateX(0deg);
608
+
609
+ }
610
+
611
+ }
612
+
613
+ ```