質問編集履歴

2

不具合が起きているHTML、CSSを追加しました。

2019/02/27 09:04

投稿

tuuli
tuuli

スコア13

test CHANGED
File without changes
test CHANGED
@@ -69,3 +69,845 @@
69
69
 
70
70
 
71
71
  よろしくお願いいたします。
72
+
73
+
74
+
75
+ - - - - - - - - - - - - - - - - - - - - - - - - -
76
+
77
+
78
+
79
+ ご指摘をいただきまして、実際に作成しましたコードを追記させていただきます。
80
+
81
+ URL、画像はダミーとなってしまい申し訳ございません(オープン前の企画のため申し訳ございません)
82
+
83
+ エラーとなるのはスマートフォンでの表示のときです。
84
+
85
+ よろしくお願いいたします。
86
+
87
+
88
+
89
+ 【CSS】長くなるためスマホ版のみ記載させていただきます。
90
+
91
+ ```ここに言語を入力
92
+
93
+ <style type="text/css">
94
+
95
+ /*-----------------*/
96
+
97
+ /*【共通】上に戻るボタン*/
98
+
99
+ /*-----------------*/
100
+
101
+ #pageTop {
102
+
103
+ position: fixed;
104
+
105
+ bottom: 70px;
106
+
107
+ right: 20px;
108
+
109
+ }
110
+
111
+
112
+
113
+ #pageTop img {
114
+
115
+ padding: 6px 0px 0px 6px;
116
+
117
+ }
118
+
119
+
120
+
121
+ #pageTop a {
122
+
123
+ display: block;
124
+
125
+ z-index: 999;
126
+
127
+ padding: 8px 0 0 8px;
128
+
129
+ border-radius: 10px;
130
+
131
+ width: 40px;
132
+
133
+ height: 40px;
134
+
135
+ background-color: #252525;
136
+
137
+ color: #fff;
138
+
139
+ font-weight: bold;
140
+
141
+ text-decoration: none;
142
+
143
+ text-align: center;
144
+
145
+ }
146
+
147
+
148
+
149
+ #pageTop a:hover {
150
+
151
+ text-decoration: none;
152
+
153
+ opacity: 0.7;
154
+
155
+ }
156
+
157
+
158
+
159
+ /*-----------------*/
160
+
161
+ /*【共通】背景透過*/
162
+
163
+ /*-----------------*/
164
+
165
+ a:hover {
166
+
167
+ opacity: 0.65; /* 25%ほど透明にする */
168
+
169
+ }
170
+
171
+
172
+
173
+
174
+
175
+ /*-----------------*/
176
+
177
+ /* 【共通】スクロールするとフェード*/
178
+
179
+ /*-----------------*/
180
+
181
+ /*
182
+
183
+ .fade {
184
+
185
+ opacity: 0;
186
+
187
+ transition: all .5s ease;
188
+
189
+ }
190
+
191
+
192
+
193
+ .fade.show {
194
+
195
+ opacity: 1;
196
+
197
+ transform: none;
198
+
199
+ }
200
+
201
+
202
+
203
+ .fadeUp {
204
+
205
+ transform: translate(0, 100px);
206
+
207
+ }
208
+
209
+ */
210
+
211
+
212
+
213
+ /*-----------------*/
214
+
215
+ /*スマホ表示*/
216
+
217
+ /*-----------------*/
218
+
219
+
220
+
221
+ @media only screen and (max-width:599px){
222
+
223
+ body {
224
+
225
+ background-image: url("");
226
+
227
+ background-repeat: no-repeat;
228
+
229
+ background-size: 100%;
230
+
231
+ background-attachment: fixed;
232
+
233
+ max-width: 98%;
234
+
235
+ }
236
+
237
+
238
+
239
+ /*【SP】メニュー*/
240
+
241
+ .menuT{
242
+
243
+ margin-top:2%;
244
+
245
+
246
+
247
+ }
248
+
249
+
250
+
251
+ .menuT img{
252
+
253
+ margin-left:2%;
254
+
255
+ margin-right:2%;
256
+
257
+ width:98%;
258
+
259
+ }
260
+
261
+
262
+
263
+ .menuT:after{
264
+
265
+ display:block;
266
+
267
+ content:"";
268
+
269
+ }
270
+
271
+
272
+
273
+
274
+
275
+ .menuB{
276
+
277
+ margin-left:3%;
278
+
279
+ margin-top:3%;
280
+
281
+ margin-bottom:-2%;
282
+
283
+ background-color:#ffe4e1;
284
+
285
+ }
286
+
287
+
288
+
289
+ .menuB:after{
290
+
291
+ display:block;
292
+
293
+ clear:both;
294
+
295
+ content:"";
296
+
297
+ }
298
+
299
+
300
+
301
+
302
+
303
+ .bnrA{
304
+
305
+ margin-top:1%;
306
+
307
+ margin-bottom:0%;
308
+
309
+ }
310
+
311
+
312
+
313
+ .bnrA img{
314
+
315
+ margin-left:2%;
316
+
317
+ margin-right:2%;
318
+
319
+ width:98%;
320
+
321
+ }
322
+
323
+
324
+
325
+ .bnrA:after{
326
+
327
+ display:block;
328
+
329
+ clear:both;
330
+
331
+ content:"";
332
+
333
+ }
334
+
335
+
336
+
337
+ .date{
338
+
339
+ margin-top:2%;
340
+
341
+ margin-bottom:2%;
342
+
343
+ }
344
+
345
+
346
+
347
+ .date img{
348
+
349
+ margin-left:2%;
350
+
351
+ margin-right:2%;
352
+
353
+ width:98%;
354
+
355
+ }
356
+
357
+
358
+
359
+ .date:after{
360
+
361
+ display:block;
362
+
363
+ clear:both;
364
+
365
+ content:"";
366
+
367
+ }
368
+
369
+
370
+
371
+
372
+
373
+ /*【SP】可変(4カラム⇒2カラム)*/
374
+
375
+ .clm4{
376
+
377
+ float:left;
378
+
379
+ width:49%;
380
+
381
+ margin-top:0%;
382
+
383
+ margin-left:1%;
384
+
385
+ margin-right:0%;
386
+
387
+ margin-bottom:0%;
388
+
389
+ }
390
+
391
+
392
+
393
+ .clm4 img{
394
+
395
+ margin-left:2%;
396
+
397
+ margin-right:0%;
398
+
399
+ width:96%;
400
+
401
+ }
402
+
403
+
404
+
405
+ .clm4R{
406
+
407
+ float:left;
408
+
409
+ width:49%;
410
+
411
+ margin-top:0%;
412
+
413
+ margin-left:0%;
414
+
415
+ margin-right:1%;
416
+
417
+ margin-bottom:0%;
418
+
419
+ }
420
+
421
+
422
+
423
+ .clm4R img{
424
+
425
+ margin-left:3%;
426
+
427
+ margin-right:0%;
428
+
429
+ width:96%;
430
+
431
+ }
432
+
433
+
434
+
435
+ /*【SP】可変(2カラム)*/
436
+
437
+
438
+
439
+ .clm2{
440
+
441
+ float:left;
442
+
443
+ width:49%;
444
+
445
+ margin-top:0%;
446
+
447
+ margin-left:1%;
448
+
449
+ margin-right:0%;
450
+
451
+ margin-bottom:2%;
452
+
453
+ }
454
+
455
+
456
+
457
+ .clm2R{
458
+
459
+ float:left;
460
+
461
+ width:49%;
462
+
463
+ margin-top:0%;
464
+
465
+ margin-left:1%;
466
+
467
+ margin-right:0%;
468
+
469
+ margin-bottom:2%;
470
+
471
+ }
472
+
473
+
474
+
475
+
476
+
477
+ .clm2 img{
478
+
479
+ margin-left:2%;
480
+
481
+ margin-right:2%;
482
+
483
+ width:96%;
484
+
485
+ }
486
+
487
+
488
+
489
+ .clm2R img{
490
+
491
+ margin-left:2%;
492
+
493
+ margin-right:2%;
494
+
495
+ width:96%;
496
+
497
+ }
498
+
499
+
500
+
501
+
502
+
503
+ /*【SP】ボトムナビゲーション用*/
504
+
505
+ .menuTop {
506
+
507
+ width:100%;
508
+
509
+ text-align: center;
510
+
511
+ padding: 0;
512
+
513
+ margin: 0;
514
+
515
+ }
516
+
517
+
518
+
519
+ .menuTop li {
520
+
521
+ width: 96%;
522
+
523
+ display: inline-block;
524
+
525
+ text-align: left;
526
+
527
+ }
528
+
529
+
530
+
531
+ .menu {
532
+
533
+ width:100%;
534
+
535
+ text-align: center;
536
+
537
+ padding: 0;
538
+
539
+ margin: 0;
540
+
541
+ }
542
+
543
+
544
+
545
+ .menu li {
546
+
547
+ width: 24%;
548
+
549
+ display: inline-block;
550
+
551
+ text-align: left;
552
+
553
+ margin-left:-1%;
554
+
555
+ }
556
+
557
+
558
+
559
+ .menu li:first-child {
560
+
561
+ margin-left: -4%;
562
+
563
+ }
564
+
565
+
566
+
567
+
568
+
569
+ .menu li:last-child {
570
+
571
+ margin-right: -4%;
572
+
573
+ }
574
+
575
+
576
+
577
+
578
+
579
+ #bottomNav{
580
+
581
+ position: fixed !important;
582
+
583
+ position: absolute;
584
+
585
+ bottom: -25px;
586
+
587
+ left:0px;
588
+
589
+ width: 100%;
590
+
591
+ height: 150px;
592
+
593
+
594
+
595
+ }
596
+
597
+
598
+
599
+ #container {
600
+
601
+ width: 100%;
602
+
603
+ position: relative;
604
+
605
+ height: auto !important;
606
+
607
+ height: 100%;
608
+
609
+ min-height: 100%;
610
+
611
+ bottom:-45px;
612
+
613
+ }
614
+
615
+
616
+
617
+ .bnrA::before {
618
+
619
+ content: "";
620
+
621
+ display: inline-block;
622
+
623
+ height: 100px;
624
+
625
+ margin-top: -100px;
626
+
627
+ vertical-align: top;
628
+
629
+ }
630
+
631
+ }
632
+
633
+
634
+
635
+ */
636
+
637
+ </style>
638
+
639
+
640
+
641
+ ```
642
+
643
+ 【HTML】
644
+
645
+ ```ここに言語を入力
646
+
647
+ <html>
648
+
649
+ -
650
+
651
+ 省略
652
+
653
+ <body>
654
+
655
+ <div class="wrapper">
656
+
657
+ <div class="menuT">
658
+
659
+ <img src=
660
+
661
+ "https://placehold.jp/960x150.png" alt="">
662
+
663
+ <br>
664
+
665
+ </div>
666
+
667
+
668
+
669
+
670
+
671
+ <div class="bnrA fade fadeUp">
672
+
673
+ <p id="pg1"><img src="https://placehold.jp/960x150.png" alt=""></p>
674
+
675
+ </div>
676
+
677
+
678
+
679
+
680
+
681
+ <div class="bnrA fade fadeUp">
682
+
683
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
684
+
685
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
686
+
687
+ <br>
688
+
689
+ </div>
690
+
691
+ <div class="bnrA fade fadeUp">
692
+
693
+ <p id="pg2"><img src="https://placehold.jp/960x150.png" alt=""></p>
694
+
695
+ </div>
696
+
697
+
698
+
699
+ <div class="date fade fadeUp">
700
+
701
+ <img src="https://placehold.jp/960x150.png" alt="">
702
+
703
+ </div>
704
+
705
+
706
+
707
+ <div class="menu2 fade fadeUp">
708
+
709
+ <div class="clm2">
710
+
711
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
712
+
713
+ </div>
714
+
715
+ <div class="clm2R">
716
+
717
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
718
+
719
+ </div>
720
+
721
+ <div class="clm2">
722
+
723
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
724
+
725
+ </div>
726
+
727
+ <div class="clm2R">
728
+
729
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
730
+
731
+ </div>
732
+
733
+ <br><br>
734
+
735
+ </div>
736
+
737
+
738
+
739
+ <div class="bnrA fade fadeUp">
740
+
741
+ <p id="pg3"><img src="https://placehold.jp/960x150.png" alt=""></p>
742
+
743
+ </div>
744
+
745
+
746
+
747
+ <div class="bnrA fade fadeUp">
748
+
749
+ <a href=""><img src="https://placehold.jp/960x150.png" alt=""></a>
750
+
751
+ </div>
752
+
753
+
754
+
755
+ <div class="bnrA fade fadeUp">
756
+
757
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
758
+
759
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
760
+
761
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
762
+
763
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
764
+
765
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
766
+
767
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
768
+
769
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
770
+
771
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
772
+
773
+
774
+
775
+ </div>
776
+
777
+ <div class="bnrA fade fadeUp">
778
+
779
+ <p id="pg4"><img src="https://placehold.jp/960x150.png" alt=""></p>
780
+
781
+ <br>
782
+
783
+ </div>
784
+
785
+
786
+
787
+ <div class="menu2 fade fadeUp">
788
+
789
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
790
+
791
+ <br><br>
792
+
793
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
794
+
795
+ <br>
796
+
797
+
798
+
799
+ </div>
800
+
801
+ <div class="bnrA fade fadeUp">
802
+
803
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
804
+
805
+ </div>
806
+
807
+ <div class="bnrA fade fadeUp">
808
+
809
+ <a href="#"><img src="https://placehold.jp/960x150.png" alt=""></a>
810
+
811
+ </div>
812
+
813
+
814
+
815
+
816
+
817
+
818
+
819
+
820
+
821
+
822
+
823
+ <!--ボトムナビゲーションここから-->
824
+
825
+ <div id="bottomNav">
826
+
827
+ <div id="container">
828
+
829
+ <!-- メニュー -->
830
+
831
+ <ul class="menuTop">
832
+
833
+ <li><a href="#pg1"><img src="https://placehold.jp/960x150.png" alt="" width="100%" /></a></li>
834
+
835
+ </ul>
836
+
837
+ <ul class="menu">
838
+
839
+ <li><a href="#pg2"><img src="https://placehold.jp/960x150.png" alt="" width="100%" /></a></li>
840
+
841
+ <li><a href="#pg3"><img src="https://placehold.jp/960x150.png" alt="" width="100%" /></a></li>
842
+
843
+ <li><a href="#pg4"><img src="https://placehold.jp/960x150.png" alt="" width="100%" /></a></li>
844
+
845
+ <li><a href="#pg5"><img src="https://placehold.jp/960x150.png" alt="" width="100%" /></a></li>
846
+
847
+ </ul>
848
+
849
+ <!-- /メニュー -->
850
+
851
+ </div>
852
+
853
+ </div>
854
+
855
+ <!--ボトムナビゲーションここまで-->
856
+
857
+
858
+
859
+ <!--上に戻るボタン-->
860
+
861
+ <p id="pageTop"><a href="#"><img src="https://image.rakuten.co.jp/jewlinge/cabinet/01089476/05587456/up_wt.gif"></a></p>
862
+
863
+ <!--/上に戻るボタン-->
864
+
865
+
866
+
867
+
868
+
869
+
870
+
871
+ <!--スクロールするとフェードJS-->
872
+
873
+ <script>
874
+
875
+ var scrollAnimationElm = document.querySelectorAll('.fade');
876
+
877
+ var scrollAnimationFunc = function() {
878
+
879
+ for(var i = 0; i < scrollAnimationElm.length; i++) {
880
+
881
+ var triggerMargin = 300;
882
+
883
+ if (window.innerHeight > scrollAnimationElm[i].getBoundingClientRect().top + triggerMargin) {
884
+
885
+ scrollAnimationElm[i].classList.add('show');
886
+
887
+ }
888
+
889
+ }
890
+
891
+ }
892
+
893
+ window.addEventListener('load', scrollAnimationFunc);
894
+
895
+ window.addEventListener('scroll', scrollAnimationFunc);
896
+
897
+ </script>
898
+
899
+ <!--/スクロールするとフェードJSここまで-->
900
+
901
+ </body>
902
+
903
+ </html>
904
+
905
+ ```
906
+
907
+
908
+
909
+ 同じダミー画像のため見難いかも知れません、申し訳ございません。
910
+
911
+ もし分かる方がいらっしゃいましたら教えていただけますと助かります。
912
+
913
+ よろしくお願いいたします。

1

id名を修正しました。

2019/02/27 09:04

投稿

tuuli
tuuli

スコア13

test CHANGED
File without changes
test CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  <div class="bnrA">
14
14
 
15
- <p id="pg3"><img src="https://placehold.jp/960x150.png" alt="看板2"></p>
15
+ <p id="pg2"><img src="https://placehold.jp/960x150.png" alt="看板2"></p>
16
16
 
17
17
  </div>
18
18
 
@@ -24,13 +24,13 @@
24
24
 
25
25
  <div class="bnrA">
26
26
 
27
- <p id="pg3"><img src="https://placehold.jp/960x150.png" alt="看板4"></p>
27
+ <p id="pg4"><img src="https://placehold.jp/960x150.png" alt="看板4"></p>
28
28
 
29
29
  </div>
30
30
 
31
31
  <div class="bnrA">
32
32
 
33
- <p id="pg3"><img src="https://placehold.jp/960x150.png" alt="看板5"></p>
33
+ <p id="pg5"><img src="https://placehold.jp/960x150.png" alt="看板5"></p>
34
34
 
35
35
  </div>
36
36