質問編集履歴

2

誤コード

2021/03/10 13:26

投稿

mayuphoo
mayuphoo

スコア13

test CHANGED
File without changes
test CHANGED
@@ -22,6 +22,8 @@
22
22
 
23
23
  ※横並びにならない ② の部分は、該当ファイル(show.html.erb)内にコメントを書いて、目印にしています。
24
24
 
25
+ ※cssは、全て1つのファイルで書いているので長くなってしまっています。見辛かったらすみません。
26
+
25
27
 
26
28
 
27
29
  どなたかご教授いただけると、幸いです。

1

誤コード

2021/03/10 13:26

投稿

mayuphoo
mayuphoo

スコア13

test CHANGED
File without changes
test CHANGED
@@ -186,16 +186,966 @@
186
186
 
187
187
  ```
188
188
 
189
- ###s
189
+ ###style.css
190
190
 
191
191
  ```
192
192
 
193
+ /* リセットCSS */
194
+
195
+ * {
196
+
197
+ box-sizing: border-box;
198
+
199
+ }
200
+
201
+
202
+
203
+ html,
204
+
205
+ body,
206
+
207
+ ul,
208
+
209
+ li,
210
+
211
+ h1,
212
+
213
+ h2,
214
+
215
+ p,
216
+
217
+ div {
218
+
219
+ margin: 0;
220
+
221
+ padding: 0;
222
+
223
+ }
224
+
225
+
226
+
227
+ body {
228
+
229
+ font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN W3", sans-serif;
230
+
231
+ color: #3b4043;
232
+
233
+ }
234
+
235
+
236
+
237
+ li {
238
+
239
+ list-style: none;
240
+
241
+ }
242
+
243
+
244
+
245
+ img {
246
+
247
+ max-width: 100%;
248
+
249
+ vertical-align: bottom;
250
+
251
+ }
252
+
253
+
254
+
255
+ a {
256
+
257
+ text-decoration: none;
258
+
259
+ color: #3b4043;
260
+
261
+ }
262
+
263
+
264
+
265
+ /* ヘッダー */
266
+
267
+
268
+
269
+ .header {
270
+
271
+ background-color: #FFDEAD;
272
+
273
+ margin-bottom: 48px;
274
+
275
+ padding: 20px 0;
276
+
277
+
278
+
279
+ }
280
+
281
+ .inner {
282
+
283
+ width: 1024px;
284
+
285
+ margin: 0 auto;
286
+
287
+ }
288
+
289
+ .nav {
290
+
291
+ width: 100%;
292
+
293
+ display: flex;
294
+
295
+ justify-content: space-between;
296
+
297
+ }
298
+
299
+ .logo {
300
+
301
+ width: 160px;
302
+
303
+ height: 35px;
304
+
305
+ }
306
+
307
+ .nav__btn{
308
+
309
+ display: inline-block;
310
+
311
+ padding: 0.4em 1.6em;
312
+
313
+ font-size: 0.8em;
314
+
315
+ color: gray;
316
+
317
+ text-decoration: none;
318
+
319
+ user-select: none;
320
+
321
+ border: 1px gray solid;
322
+
323
+ border-radius: 3px;
324
+
325
+ transition: 0.4s ease;
326
+
327
+ }
328
+
329
+ .nav__btn:hover{
330
+
331
+ color: #fff;
332
+
333
+ background: gray;
334
+
335
+ }
336
+
337
+
338
+
339
+ .nav__logout{
340
+
341
+ display: inline-block;
342
+
343
+ padding: 0.4em 1.6em;
344
+
345
+ font-size: 0.9em;
346
+
347
+ color: gray;
348
+
349
+ text-decoration: none;
350
+
351
+ user-select: none;
352
+
353
+ margin-left: 50px;
354
+
355
+ }
356
+
357
+ .nav__logout:hover{
358
+
359
+ opacity: 0.5;
360
+
361
+ }
362
+
363
+
364
+
365
+ .nav__name{
366
+
367
+ display: inline-block;
368
+
369
+ padding: 0.4em 1.6em;
370
+
371
+ font-size: 0.9em;
372
+
373
+ color: gray;
374
+
375
+ text-decoration: none;
376
+
377
+ user-select: none;
378
+
379
+
380
+
381
+ }
382
+
383
+
384
+
385
+ .nav__name:hover{
386
+
387
+ opacity: 0.5;
388
+
389
+ }
390
+
391
+
392
+
393
+ .search_form{
394
+
395
+ margin-top: 5px;
396
+
397
+ }
398
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+ /* フォーム周り */
406
+
407
+ .form__wrapper{
408
+
409
+ min-height: calc(100vh - 161px);
410
+
411
+ }
412
+
413
+
414
+
415
+ .form__text {
416
+
417
+ width: 50%;
418
+
419
+ }
420
+
421
+
422
+
423
+ .field{
424
+
425
+ margin: 10px 0;
426
+
427
+ }
428
+
429
+
430
+
431
+ .actions{
432
+
433
+ margin-bottom: 40px;
434
+
435
+ }
436
+
437
+
438
+
439
+ .form__btn{
440
+
441
+ display: inline-block;
442
+
443
+ padding: 0.4em 1.6em;
444
+
445
+ font-size: 0.8em;
446
+
447
+ color: #fff;
448
+
449
+ text-decoration: none;
450
+
451
+ user-select: none;
452
+
453
+ background: #87CEFA;
454
+
455
+ border: 1px #87CEFA solid;
456
+
457
+ border-radius: 3px;
458
+
459
+ box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.14), 0 1px 2px 0 rgba(0, 0, 0, 0.12);
460
+
461
+ transition: 0.2s ease;
462
+
463
+ }
464
+
465
+
466
+
467
+ .form__btn:hover {
468
+
469
+ box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.2), 0 1px 8px 0 rgba(0, 0, 0, 0.12);
470
+
471
+ cursor: pointer;
472
+
473
+ }
474
+
475
+
476
+
477
+ /* メイン */
478
+
479
+
480
+
481
+ .greeting{
482
+
483
+ margin-bottom: 20px;
484
+
485
+ }
486
+
487
+ .greeting__link{
488
+
489
+ text-decoration: underline;
490
+
491
+ }
492
+
493
+ .page-heading {
494
+
495
+ font-size: 30px;
496
+
497
+ margin-bottom: 28px;
498
+
499
+ }
500
+
501
+ .card__wrapper {
502
+
503
+ display: flex;
504
+
505
+ flex-wrap: wrap;
506
+
507
+ justify-content: space-between;
508
+
509
+ align-items: center;
510
+
511
+ min-height: calc(100vh - 161px);
512
+
513
+ }
514
+
515
+ .card {
516
+
517
+ width: calc((100% - 50px) / 3);
518
+
519
+ margin-bottom: 40px;
520
+
521
+ }
522
+
523
+ .card__img {
524
+
525
+ margin-bottom: 16px;
526
+
527
+ }
528
+
529
+ .card__title {
530
+
531
+ display: block;
532
+
533
+ font-size: 20px;
534
+
535
+ margin-bottom: 8px;
536
+
537
+ font-weight: bold;
538
+
539
+ }
540
+
541
+ .card__summary {
542
+
543
+ font-size: 16px;
544
+
545
+ }
546
+
547
+ .card__user {
548
+
549
+ display: block;
550
+
551
+ font-size: 12px;
552
+
553
+ color: #999;
554
+
555
+ text-align: right;
556
+
557
+ text-decoration: underline;
558
+
559
+ }
560
+
561
+
562
+
563
+
564
+
565
+
566
+
567
+ .tag{
568
+
569
+ position: relative;
570
+
571
+ display: inline-block;
572
+
573
+ padding: 0rem 5px 0rem 6px;
574
+
575
+ color: #fff;
576
+
577
+ border-radius: 100vh 0 0 100vh;
578
+
579
+ background: #fa4141;
580
+
581
+ font-size: 12px;
582
+
583
+ }
584
+
585
+
586
+
587
+ tag:before {
588
+
589
+ position: absolute;
590
+
591
+ top: calc(50% - 7px);
592
+
593
+ left: 10px;
594
+
595
+ width: 14px;
596
+
597
+ height: 14px;
598
+
599
+ content: '';
600
+
601
+ border-radius: 50%;
602
+
603
+ background: #fff;
604
+
605
+ }
606
+
607
+
608
+
609
+ .show_tag{
610
+
611
+ position: relative;
612
+
613
+ display: inline-block;
614
+
615
+ padding: 0rem 5px 0rem 6px;
616
+
617
+ color: #fff;
618
+
619
+ border-radius: 100vh 0 0 100vh;
620
+
621
+ background: #fa4141;
622
+
623
+ font-size: 12px;
624
+
625
+ margin-left: 30%;
626
+
627
+ }
628
+
629
+
630
+
631
+ show_tag:before {
632
+
633
+ position: absolute;
634
+
635
+ top: calc(50% - 7px);
636
+
637
+ left: 10px;
638
+
639
+ width: 14px;
640
+
641
+ height: 14px;
642
+
643
+ content: '';
644
+
645
+ border-radius: 50%;
646
+
647
+ background: #fff;
648
+
649
+ }
650
+
651
+
652
+
653
+
654
+
655
+
656
+
657
+
658
+
659
+
660
+
661
+ .show-lists{
662
+
663
+ width: 200px;
664
+
665
+ position: absolute;
666
+
667
+ right: 400px;
668
+
669
+ top: 80px;
670
+
671
+ background-color: #ffffff;
672
+
673
+ }
674
+
675
+
676
+
677
+ .pull-down-list{
678
+
679
+ padding: 10px 0px 5px 20px;
680
+
681
+ border: 1px solid #eee;
682
+
683
+ font-size: 13px;
684
+
685
+ }
686
+
687
+
688
+
689
+ .hidden{
690
+
691
+ display: none;
692
+
693
+ }
694
+
695
+
696
+
697
+ /* いいね */
698
+
699
+ .like_group{
700
+
701
+ display:flex;
702
+
703
+ }
704
+
705
+
706
+
707
+ .like_btn{
708
+
709
+ width: 50px;
710
+
711
+ height: 33px;
712
+
713
+ }
714
+
715
+
716
+
717
+
718
+
719
+ .fa-heart:before {
720
+
721
+ font-size: 20px;
722
+
723
+ }
724
+
725
+
726
+
727
+ .fa-heart:before {
728
+
729
+ color: #c70909;
730
+
731
+ }
732
+
733
+
734
+
735
+ .count-number{
736
+
737
+ font-size: 18px;
738
+
739
+ }
740
+
741
+
742
+
743
+ .post-count-number{
744
+
745
+ margin-left: 5px;
746
+
747
+ margin-top: -1px;
748
+
749
+ }
750
+
751
+
752
+
753
+ /* 詳細ページ */
754
+
755
+ .prototype__wrapper{
756
+
757
+ min-height: calc(100vh - 161px);
758
+
759
+ }
760
+
761
+ .prototype__hedding{
762
+
763
+ font-size: 24px;
764
+
765
+ font-weight: bold;
766
+
767
+ text-align: center;
768
+
769
+ }
770
+
771
+ .prototype__user{
772
+
773
+ display: block;
774
+
775
+ font-size: 16px;
776
+
777
+ color: #999;
778
+
779
+ text-align: center;
780
+
781
+ text-decoration: underline;
782
+
783
+ }
784
+
785
+ .prototype__image{
786
+
787
+ width: 40%;
788
+
789
+ margin: 0 auto;
790
+
791
+ padding: 16px 0;
792
+
793
+ }
794
+
795
+ .prototype__detail{
796
+
797
+ display: flex;
798
+
799
+ align-items: center;
800
+
801
+ flex-direction: column;
802
+
803
+ margin-bottom: 8px;
804
+
805
+ }
806
+
807
+ .detail__title{
808
+
809
+ font-size: 20px;
810
+
811
+ font-weight: bold;
812
+
813
+ }
814
+
815
+ .prototype__manage{
816
+
817
+ display: flex;
818
+
819
+ justify-content: center;
820
+
821
+ padding-top: 16px;
822
+
823
+ }
824
+
825
+ .prototype__btn{
826
+
827
+ display: block;
828
+
829
+ padding: 0.4em 1.6em;
830
+
831
+ font-size: 0.4em;
832
+
833
+ color: #999;
834
+
835
+ text-decoration: none;
836
+
837
+ user-select: none;
838
+
839
+ border: 1px #999 solid;
840
+
841
+ border-radius: 3px;
842
+
843
+ transition: 0.4s ease;
844
+
845
+ margin: 0 4px;
846
+
847
+ }
848
+
849
+ .prototype__btn:hover{
850
+
851
+ color: #fff;
852
+
853
+ background: #999;
854
+
855
+ }
856
+
857
+
858
+
859
+ .prototype__comments{
860
+
861
+ background-color: #FFF0F5;
862
+
863
+ padding: 20px;
864
+
865
+ margin: 28px 0 40px 0;
866
+
867
+ }
868
+
869
+
870
+
871
+ .comments_lists{
872
+
873
+ padding-left: 20px;
874
+
875
+ }
876
+
877
+
878
+
879
+ .comments_list{
880
+
881
+ list-style-type: square;
882
+
883
+ padding-bottom: 5px;
884
+
885
+ }
886
+
887
+
888
+
889
+ .comment_user{
890
+
891
+ font-size: 16px;
892
+
893
+ color: #999;
894
+
895
+ text-decoration: underline;
896
+
897
+ }
898
+
899
+
900
+
901
+ /* カテゴリ一覧ページ */
902
+
903
+ .category_card {
904
+
905
+ width: calc((100% - 50px) / 3);
906
+
907
+ margin: 40px;
908
+
909
+ }
910
+
911
+
912
+
913
+ .category_parent {
914
+
915
+ display: flex;
916
+
917
+ flex-wrap: wrap;
918
+
919
+ justify-content: space-between;
920
+
921
+ align-items: center;
922
+
923
+ }
924
+
925
+ .category_child {
926
+
927
+ width: calc((100% - -180px) / 3);
928
+
929
+ margin-bottom: 30px;
930
+
931
+ }
932
+
933
+
934
+
935
+
936
+
937
+ .category_title{
938
+
939
+ font-size: 28px;
940
+
941
+ margin-bottom: 50px;
942
+
943
+ }
944
+
945
+
946
+
947
+ .no_category_card{
948
+
949
+ width: calc((100% - 50px) / 3);
950
+
951
+ margin: 40px;
952
+
953
+ display: flex;
954
+
955
+ }
956
+
957
+
958
+
959
+ .no_category{
960
+
961
+ text-align: center;
962
+
963
+ font-size: 20px;
964
+
965
+ }
966
+
967
+
968
+
969
+ /* ユーザーページ */
970
+
971
+ .user__wrapper{
972
+
973
+ min-height: calc(100vh - 161px);
974
+
975
+ }
976
+
977
+ .table{
978
+
979
+ border-collapse: collapse;
980
+
981
+ margin-bottom: 32px;
982
+
983
+ width: 50%;
984
+
985
+ }
986
+
987
+ .table__col1{
988
+
989
+ text-align: left;
990
+
991
+ font-weight: bold;
992
+
993
+ background: #fafafa;
994
+
995
+ border-collapse: collapse;
996
+
997
+ border: 1px solid #f5f5f5;
998
+
999
+ width: 30%;
1000
+
1001
+ padding: 8px;
1002
+
1003
+ }
1004
+
1005
+ .table__col2{
1006
+
1007
+ text-align: left;
1008
+
1009
+ border: 1px solid #f5f5f5;
1010
+
1011
+ border-collapse: collapse;
1012
+
1013
+ width: 70%;
1014
+
1015
+ padding: 16px 8px;
1016
+
1017
+ }
1018
+
1019
+ .user__card {
1020
+
1021
+ display: flex;
1022
+
1023
+ flex-wrap: wrap;
1024
+
1025
+ justify-content: space-between;
1026
+
1027
+ align-items: center;
1028
+
1029
+ }
1030
+
1031
+
1032
+
1033
+ .page-heading{
1034
+
1035
+ margin-left: -30px;
1036
+
1037
+ }
1038
+
1039
+
1040
+
1041
+ /* フッター */
1042
+
1043
+
1044
+
1045
+ .footer {
1046
+
1047
+ background-color: #999;
1048
+
1049
+ padding: 10px 0;
1050
+
1051
+ }
1052
+
1053
+ .copyright {
1054
+
1055
+ text-align: center;
1056
+
1057
+ color: #fff;
1058
+
1059
+ font-size: 10px;
1060
+
1061
+ }
1062
+
1063
+
1064
+
1065
+ /* タブレット対応 */
1066
+
1067
+ @media (max-width: 1024px) {
1068
+
1069
+ .inner {
1070
+
1071
+ width: 90%;
1072
+
1073
+ margin: 0 auto;
1074
+
1075
+ }
1076
+
1077
+ .page-heading {
1078
+
1079
+ font-size: 24px;
1080
+
1081
+ }
1082
+
1083
+ .card {
1084
+
1085
+ width: 48%;
1086
+
1087
+ margin-bottom: 40px;
1088
+
1089
+ }
1090
+
1091
+ .prototype_image{
1092
+
1093
+ width: 60%;
1094
+
1095
+ }
1096
+
1097
+ }
1098
+
1099
+
1100
+
1101
+ /* スマホ表示 */
1102
+
1103
+ @media (max-width: 599px) {
1104
+
1105
+ .logo {
1106
+
1107
+ width: 120px;
1108
+
1109
+ }
1110
+
1111
+ .page-heading {
1112
+
1113
+ font-size: 20px;
1114
+
1115
+ }
1116
+
1117
+ .card {
1118
+
1119
+ width: 100%;
1120
+
1121
+ margin-bottom: 60px;
1122
+
1123
+ }
1124
+
1125
+ .card__title {
1126
+
1127
+ font-size: 18px;
1128
+
1129
+ }
1130
+
1131
+ .card__summary {
1132
+
1133
+ font-size: 14px;
1134
+
1135
+ }
1136
+
1137
+ .prototype_image{
1138
+
1139
+ width: 100%;
1140
+
1141
+ }
1142
+
1143
+ .table{
1144
+
1145
+ width: 100%;
1146
+
1147
+ }
1148
+
1149
+ }
1150
+
193
1151
  ```
194
-
195
-
196
-
197
- ### 補足情報(FW/ツールのバージョンなど)
198
-
199
-
200
-
201
- Rails6.0.0 ver.