teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

誤コード

2021/03/10 13:26

投稿

mayuphoo
mayuphoo

スコア13

title CHANGED
File without changes
body CHANGED
@@ -10,6 +10,7 @@
10
10
 
11
11
  ※①ユーザーの投稿記事一覧は、部分テンプレート(_post.html.erb)を呼び出して実装しています。
12
12
  ※横並びにならない ② の部分は、該当ファイル(show.html.erb)内にコメントを書いて、目印にしています。
13
+ ※cssは、全て1つのファイルで書いているので長くなってしまっています。見辛かったらすみません。
13
14
 
14
15
  どなたかご教授いただけると、幸いです。
15
16
  宜しくお願い致します。

1

誤コード

2021/03/10 13:26

投稿

mayuphoo
mayuphoo

スコア13

title CHANGED
File without changes
body CHANGED
@@ -92,10 +92,485 @@
92
92
  </div>
93
93
 
94
94
  ```
95
- ###s
95
+ ###style.css
96
96
  ```
97
+ /* リセットCSS */
97
- ```
98
+ * {
99
+ box-sizing: border-box;
100
+ }
98
101
 
102
+ html,
103
+ body,
104
+ ul,
105
+ li,
106
+ h1,
107
+ h2,
108
+ p,
109
+ div {
110
+ margin: 0;
99
- ### 補足情報(FW/ツールのバージョンなど)
111
+ padding: 0;
112
+ }
100
113
 
114
+ body {
115
+ font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN W3", sans-serif;
116
+ color: #3b4043;
117
+ }
118
+
119
+ li {
120
+ list-style: none;
121
+ }
122
+
123
+ img {
124
+ max-width: 100%;
125
+ vertical-align: bottom;
126
+ }
127
+
128
+ a {
129
+ text-decoration: none;
130
+ color: #3b4043;
131
+ }
132
+
133
+ /* ヘッダー */
134
+
135
+ .header {
136
+ background-color: #FFDEAD;
137
+ margin-bottom: 48px;
138
+ padding: 20px 0;
139
+
140
+ }
141
+ .inner {
142
+ width: 1024px;
143
+ margin: 0 auto;
144
+ }
145
+ .nav {
146
+ width: 100%;
147
+ display: flex;
148
+ justify-content: space-between;
149
+ }
150
+ .logo {
151
+ width: 160px;
152
+ height: 35px;
153
+ }
154
+ .nav__btn{
155
+ display: inline-block;
156
+ padding: 0.4em 1.6em;
157
+ font-size: 0.8em;
158
+ color: gray;
159
+ text-decoration: none;
160
+ user-select: none;
161
+ border: 1px gray solid;
162
+ border-radius: 3px;
163
+ transition: 0.4s ease;
164
+ }
101
- Rails6.0.0 ver.
165
+ .nav__btn:hover{
166
+ color: #fff;
167
+ background: gray;
168
+ }
169
+
170
+ .nav__logout{
171
+ display: inline-block;
172
+ padding: 0.4em 1.6em;
173
+ font-size: 0.9em;
174
+ color: gray;
175
+ text-decoration: none;
176
+ user-select: none;
177
+ margin-left: 50px;
178
+ }
179
+ .nav__logout:hover{
180
+ opacity: 0.5;
181
+ }
182
+
183
+ .nav__name{
184
+ display: inline-block;
185
+ padding: 0.4em 1.6em;
186
+ font-size: 0.9em;
187
+ color: gray;
188
+ text-decoration: none;
189
+ user-select: none;
190
+
191
+ }
192
+
193
+ .nav__name:hover{
194
+ opacity: 0.5;
195
+ }
196
+
197
+ .search_form{
198
+ margin-top: 5px;
199
+ }
200
+
201
+
202
+
203
+ /* フォーム周り */
204
+ .form__wrapper{
205
+ min-height: calc(100vh - 161px);
206
+ }
207
+
208
+ .form__text {
209
+ width: 50%;
210
+ }
211
+
212
+ .field{
213
+ margin: 10px 0;
214
+ }
215
+
216
+ .actions{
217
+ margin-bottom: 40px;
218
+ }
219
+
220
+ .form__btn{
221
+ display: inline-block;
222
+ padding: 0.4em 1.6em;
223
+ font-size: 0.8em;
224
+ color: #fff;
225
+ text-decoration: none;
226
+ user-select: none;
227
+ background: #87CEFA;
228
+ border: 1px #87CEFA solid;
229
+ border-radius: 3px;
230
+ box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.14), 0 1px 2px 0 rgba(0, 0, 0, 0.12);
231
+ transition: 0.2s ease;
232
+ }
233
+
234
+ .form__btn:hover {
235
+ box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.2), 0 1px 8px 0 rgba(0, 0, 0, 0.12);
236
+ cursor: pointer;
237
+ }
238
+
239
+ /* メイン */
240
+
241
+ .greeting{
242
+ margin-bottom: 20px;
243
+ }
244
+ .greeting__link{
245
+ text-decoration: underline;
246
+ }
247
+ .page-heading {
248
+ font-size: 30px;
249
+ margin-bottom: 28px;
250
+ }
251
+ .card__wrapper {
252
+ display: flex;
253
+ flex-wrap: wrap;
254
+ justify-content: space-between;
255
+ align-items: center;
256
+ min-height: calc(100vh - 161px);
257
+ }
258
+ .card {
259
+ width: calc((100% - 50px) / 3);
260
+ margin-bottom: 40px;
261
+ }
262
+ .card__img {
263
+ margin-bottom: 16px;
264
+ }
265
+ .card__title {
266
+ display: block;
267
+ font-size: 20px;
268
+ margin-bottom: 8px;
269
+ font-weight: bold;
270
+ }
271
+ .card__summary {
272
+ font-size: 16px;
273
+ }
274
+ .card__user {
275
+ display: block;
276
+ font-size: 12px;
277
+ color: #999;
278
+ text-align: right;
279
+ text-decoration: underline;
280
+ }
281
+
282
+
283
+
284
+ .tag{
285
+ position: relative;
286
+ display: inline-block;
287
+ padding: 0rem 5px 0rem 6px;
288
+ color: #fff;
289
+ border-radius: 100vh 0 0 100vh;
290
+ background: #fa4141;
291
+ font-size: 12px;
292
+ }
293
+
294
+ tag:before {
295
+ position: absolute;
296
+ top: calc(50% - 7px);
297
+ left: 10px;
298
+ width: 14px;
299
+ height: 14px;
300
+ content: '';
301
+ border-radius: 50%;
302
+ background: #fff;
303
+ }
304
+
305
+ .show_tag{
306
+ position: relative;
307
+ display: inline-block;
308
+ padding: 0rem 5px 0rem 6px;
309
+ color: #fff;
310
+ border-radius: 100vh 0 0 100vh;
311
+ background: #fa4141;
312
+ font-size: 12px;
313
+ margin-left: 30%;
314
+ }
315
+
316
+ show_tag:before {
317
+ position: absolute;
318
+ top: calc(50% - 7px);
319
+ left: 10px;
320
+ width: 14px;
321
+ height: 14px;
322
+ content: '';
323
+ border-radius: 50%;
324
+ background: #fff;
325
+ }
326
+
327
+
328
+
329
+
330
+
331
+ .show-lists{
332
+ width: 200px;
333
+ position: absolute;
334
+ right: 400px;
335
+ top: 80px;
336
+ background-color: #ffffff;
337
+ }
338
+
339
+ .pull-down-list{
340
+ padding: 10px 0px 5px 20px;
341
+ border: 1px solid #eee;
342
+ font-size: 13px;
343
+ }
344
+
345
+ .hidden{
346
+ display: none;
347
+ }
348
+
349
+ /* いいね */
350
+ .like_group{
351
+ display:flex;
352
+ }
353
+
354
+ .like_btn{
355
+ width: 50px;
356
+ height: 33px;
357
+ }
358
+
359
+
360
+ .fa-heart:before {
361
+ font-size: 20px;
362
+ }
363
+
364
+ .fa-heart:before {
365
+ color: #c70909;
366
+ }
367
+
368
+ .count-number{
369
+ font-size: 18px;
370
+ }
371
+
372
+ .post-count-number{
373
+ margin-left: 5px;
374
+ margin-top: -1px;
375
+ }
376
+
377
+ /* 詳細ページ */
378
+ .prototype__wrapper{
379
+ min-height: calc(100vh - 161px);
380
+ }
381
+ .prototype__hedding{
382
+ font-size: 24px;
383
+ font-weight: bold;
384
+ text-align: center;
385
+ }
386
+ .prototype__user{
387
+ display: block;
388
+ font-size: 16px;
389
+ color: #999;
390
+ text-align: center;
391
+ text-decoration: underline;
392
+ }
393
+ .prototype__image{
394
+ width: 40%;
395
+ margin: 0 auto;
396
+ padding: 16px 0;
397
+ }
398
+ .prototype__detail{
399
+ display: flex;
400
+ align-items: center;
401
+ flex-direction: column;
402
+ margin-bottom: 8px;
403
+ }
404
+ .detail__title{
405
+ font-size: 20px;
406
+ font-weight: bold;
407
+ }
408
+ .prototype__manage{
409
+ display: flex;
410
+ justify-content: center;
411
+ padding-top: 16px;
412
+ }
413
+ .prototype__btn{
414
+ display: block;
415
+ padding: 0.4em 1.6em;
416
+ font-size: 0.4em;
417
+ color: #999;
418
+ text-decoration: none;
419
+ user-select: none;
420
+ border: 1px #999 solid;
421
+ border-radius: 3px;
422
+ transition: 0.4s ease;
423
+ margin: 0 4px;
424
+ }
425
+ .prototype__btn:hover{
426
+ color: #fff;
427
+ background: #999;
428
+ }
429
+
430
+ .prototype__comments{
431
+ background-color: #FFF0F5;
432
+ padding: 20px;
433
+ margin: 28px 0 40px 0;
434
+ }
435
+
436
+ .comments_lists{
437
+ padding-left: 20px;
438
+ }
439
+
440
+ .comments_list{
441
+ list-style-type: square;
442
+ padding-bottom: 5px;
443
+ }
444
+
445
+ .comment_user{
446
+ font-size: 16px;
447
+ color: #999;
448
+ text-decoration: underline;
449
+ }
450
+
451
+ /* カテゴリ一覧ページ */
452
+ .category_card {
453
+ width: calc((100% - 50px) / 3);
454
+ margin: 40px;
455
+ }
456
+
457
+ .category_parent {
458
+ display: flex;
459
+ flex-wrap: wrap;
460
+ justify-content: space-between;
461
+ align-items: center;
462
+ }
463
+ .category_child {
464
+ width: calc((100% - -180px) / 3);
465
+ margin-bottom: 30px;
466
+ }
467
+
468
+
469
+ .category_title{
470
+ font-size: 28px;
471
+ margin-bottom: 50px;
472
+ }
473
+
474
+ .no_category_card{
475
+ width: calc((100% - 50px) / 3);
476
+ margin: 40px;
477
+ display: flex;
478
+ }
479
+
480
+ .no_category{
481
+ text-align: center;
482
+ font-size: 20px;
483
+ }
484
+
485
+ /* ユーザーページ */
486
+ .user__wrapper{
487
+ min-height: calc(100vh - 161px);
488
+ }
489
+ .table{
490
+ border-collapse: collapse;
491
+ margin-bottom: 32px;
492
+ width: 50%;
493
+ }
494
+ .table__col1{
495
+ text-align: left;
496
+ font-weight: bold;
497
+ background: #fafafa;
498
+ border-collapse: collapse;
499
+ border: 1px solid #f5f5f5;
500
+ width: 30%;
501
+ padding: 8px;
502
+ }
503
+ .table__col2{
504
+ text-align: left;
505
+ border: 1px solid #f5f5f5;
506
+ border-collapse: collapse;
507
+ width: 70%;
508
+ padding: 16px 8px;
509
+ }
510
+ .user__card {
511
+ display: flex;
512
+ flex-wrap: wrap;
513
+ justify-content: space-between;
514
+ align-items: center;
515
+ }
516
+
517
+ .page-heading{
518
+ margin-left: -30px;
519
+ }
520
+
521
+ /* フッター */
522
+
523
+ .footer {
524
+ background-color: #999;
525
+ padding: 10px 0;
526
+ }
527
+ .copyright {
528
+ text-align: center;
529
+ color: #fff;
530
+ font-size: 10px;
531
+ }
532
+
533
+ /* タブレット対応 */
534
+ @media (max-width: 1024px) {
535
+ .inner {
536
+ width: 90%;
537
+ margin: 0 auto;
538
+ }
539
+ .page-heading {
540
+ font-size: 24px;
541
+ }
542
+ .card {
543
+ width: 48%;
544
+ margin-bottom: 40px;
545
+ }
546
+ .prototype_image{
547
+ width: 60%;
548
+ }
549
+ }
550
+
551
+ /* スマホ表示 */
552
+ @media (max-width: 599px) {
553
+ .logo {
554
+ width: 120px;
555
+ }
556
+ .page-heading {
557
+ font-size: 20px;
558
+ }
559
+ .card {
560
+ width: 100%;
561
+ margin-bottom: 60px;
562
+ }
563
+ .card__title {
564
+ font-size: 18px;
565
+ }
566
+ .card__summary {
567
+ font-size: 14px;
568
+ }
569
+ .prototype_image{
570
+ width: 100%;
571
+ }
572
+ .table{
573
+ width: 100%;
574
+ }
575
+ }
576
+ ```