質問編集履歴

1

追記、CSSファイルの公開

2020/12/03 22:31

投稿

tekeTECH
tekeTECH

スコア8

test CHANGED
File without changes
test CHANGED
@@ -347,3 +347,231 @@
347
347
  ***
348
348
 
349
349
  自分の知識不足もあり、何がいけないのかという仮説を立てることができませんでした。Javascriptの学び直しも並行して行っていますが、もし、解決法が分かる方がいたらご教授願いたいです。必要があれば、解決に向けて質問して頂いても構いません。よろしくお願い致します。
350
+
351
+
352
+
353
+ ***
354
+
355
+ 12/4追記
356
+
357
+ 同じコードをrailsではなく、単に「index.html」と「index.css」「main.js」といった3つのファイルを作り、それぞれ参照できるようにコードを記述して試すと、思い通りの表示がされました。このことから、railsを通すことで何かしらエラーが起きる原因があると思われます。cssの記述も載せておきますきます。
358
+
359
+ app/assets/stylesheets/events/index.css
360
+
361
+ ```ruby
362
+
363
+ body {
364
+
365
+ box-sizing: border-box;
366
+
367
+ height: 800px;
368
+
369
+ font-size: 20px;
370
+
371
+ text-align: center;
372
+
373
+ }
374
+
375
+
376
+
377
+ .top-content {
378
+
379
+ width: 100vw;
380
+
381
+ height: 100px;
382
+
383
+ display: flex;
384
+
385
+ align-items: center;
386
+
387
+ background-color: skyblue;
388
+
389
+ }
390
+
391
+
392
+
393
+ .main-title {
394
+
395
+ font-size: 30px;
396
+
397
+ height: 100%;
398
+
399
+ }
400
+
401
+
402
+
403
+ .title-content {
404
+
405
+ width: 70vw;
406
+
407
+ font-size: 20px;
408
+
409
+ }
410
+
411
+
412
+
413
+ .login-content {
414
+
415
+ width: 30vw;
416
+
417
+ height: 100%;
418
+
419
+ font-size: 20px;
420
+
421
+ display: flex;
422
+
423
+ justify-content: space-around;
424
+
425
+ align-items: center;
426
+
427
+ background-color: pink;
428
+
429
+ }
430
+
431
+
432
+
433
+ .user-box {
434
+
435
+ padding: 10px;
436
+
437
+ border: 2px solid white;
438
+
439
+ }
440
+
441
+
442
+
443
+ .todo-countdown {
444
+
445
+ background-color: lime;
446
+
447
+ height: 100px;
448
+
449
+ }
450
+
451
+
452
+
453
+ body {
454
+
455
+ font-family: 'Courier New', monospace;
456
+
457
+ font-size: 20px;
458
+
459
+ }
460
+
461
+
462
+
463
+ table {
464
+
465
+ height: calc(100% - 250px);
466
+
467
+ width: 100vw;
468
+
469
+ padding: 10px;
470
+
471
+ margin: 0 auto;
472
+
473
+ border-collapse: collapse;
474
+
475
+ border: 2px solid #eee;
476
+
477
+ text-align: center;
478
+
479
+ }
480
+
481
+
482
+
483
+ thead,
484
+
485
+ tfoot {
486
+
487
+ background: #eee;
488
+
489
+ text-align: center;
490
+
491
+ }
492
+
493
+
494
+
495
+ th,
496
+
497
+ tr,
498
+
499
+ td {
500
+
501
+ padding: 8px;
502
+
503
+ text-align: center;
504
+
505
+ }
506
+
507
+
508
+
509
+ td {
510
+
511
+ vertical-align: top;
512
+
513
+ }
514
+
515
+
516
+
517
+ tbody td:first-child {
518
+
519
+ color: red;
520
+
521
+ }
522
+
523
+ tbody td:last-child {
524
+
525
+ color: blue;
526
+
527
+ }
528
+
529
+
530
+
531
+ td.disabled {
532
+
533
+ opacity: 0.3;
534
+
535
+ }
536
+
537
+
538
+
539
+ td.today {
540
+
541
+ font-weight: bold;
542
+
543
+ }
544
+
545
+
546
+
547
+ tfoot {
548
+
549
+ font-weight: bold;
550
+
551
+ }
552
+
553
+
554
+
555
+ #prev,
556
+
557
+ #next,
558
+
559
+ #today {
560
+
561
+ cursor: pointer;
562
+
563
+ user-select: none;
564
+
565
+ }
566
+
567
+
568
+
569
+ footer {
570
+
571
+ background-color: yellow;
572
+
573
+ line-height: 50px;
574
+
575
+ }
576
+
577
+ ```