質問編集履歴

2

動画追加

2019/10/02 14:29

投稿

Silky
Silky

スコア34

test CHANGED
File without changes
test CHANGED
@@ -2,12 +2,384 @@
2
2
 
3
3
  (正確には、デベロッパーツールで幅を拡大したり縮小したりすると、隙間ができたりできなかったり、ガタガタします。)
4
4
 
5
+
6
+
7
+
8
+
5
- ![イメージ説明](21b83f2f9133ec769eaeb1bbb8a6806e.png)
9
+ ![イメージ説明](ceeca4fa2eab53d7592543c6a09a226d.gif)
10
+
6
-
11
+ ちなみに、図の「おしらせ」と「ブログ」のcssは色以外はほぼ同じ構造ですが、
12
+
13
+ 「おしらせ」の方のみこの隙間ができてしまいます。
14
+
15
+
16
+
17
+ この隙間の理由がわかる方いらっしゃいましたら、教えていただけないでしょうか?
18
+
19
+
20
+
21
+ ちなみに、動作確認はchrome最新バージョン: 77.0.3865.90(Official Build) (64 ビット)
22
+
23
+ で行っています。
24
+
25
+
26
+
27
+
28
+
7
- 親要素のクラスはnews、子クラスはnews__headerとなります。
29
+ 全てのソースを載せておきます。(標題で言っている親要素のクラスはnews、子クラスはnews__headerとなります。)
8
30
 
9
31
  ```ここに言語を入力
10
32
 
33
+ <!DOCTYPE html>
34
+
35
+ <html lang="en">
36
+
37
+
38
+
39
+ <head>
40
+
41
+ <meta charset="UTF-8">
42
+
43
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
44
+
45
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
46
+
47
+ <title>Document</title>
48
+
49
+ <link rel="stylesheet" href="https://unpkg.com/ress/dist/ress.min.css">
50
+
51
+ <link rel="stylesheet" href="css/widget.css">
52
+
53
+ </head>
54
+
55
+
56
+
57
+ <body>
58
+
59
+ <section class="widget section">
60
+
61
+ <h3 class="section__ttl">Widget</h3>
62
+
63
+ <div class="widget__inner">
64
+
65
+ <div class="news">
66
+
67
+ <div class="news__header">
68
+
69
+ <h4 class="news__header-ttl">おしらせ</h4>
70
+
71
+ <a href="#" class="news__header-btn">more...</a>
72
+
73
+ </div>
74
+
75
+ <div class="news__body">
76
+
77
+ <ul class="news__list">
78
+
79
+ <li class="news__item">
80
+
81
+ <div class="news__meta">
82
+
83
+ <time class="news__meta-time">2019-01-30</time>
84
+
85
+ <span class="news__meta-label">注目</span>
86
+
87
+ </div>
88
+
89
+ <p class="news__ttl">ニュースニュースニュースニュースニュース<br>ニュースニュースニュースニュース</p>
90
+
91
+ </li>
92
+
93
+ <li class="news__item">
94
+
95
+ <div class="news__meta">
96
+
97
+ <time class="news__meta-time">2019-01-30</time>
98
+
99
+ <span class="news__meta-label">注目</span>
100
+
101
+ </div>
102
+
103
+ <p class="news__ttl">ニュースニュースニュースニュースニュース<br>ニュースニュースニュースニュース</p>
104
+
105
+ </li>
106
+
107
+ <li class="news__item">
108
+
109
+ <div class="news__meta">
110
+
111
+ <time class="news__meta-time">2019-01-30</time>
112
+
113
+ <span class="news__meta-label">注目</span>
114
+
115
+ </div>
116
+
117
+ <p class="news__ttl">ニュースニュースニュースニュースニュース<br>ニュースニュースニュースニュース</p>
118
+
119
+ </li>
120
+
121
+ </ul>
122
+
123
+ </div>
124
+
125
+ </div>
126
+
127
+ <div class="blog">
128
+
129
+ <div class="blog__header">
130
+
131
+ <h4 class="blog__header-ttl">ブログ</h4>
132
+
133
+ <a href="#" class="blog__header-btn">more...</a>
134
+
135
+ </div>
136
+
137
+ <div class="blog__body">
138
+
139
+ <ul class="blog__list">
140
+
141
+ <li class="blog__item">
142
+
143
+ <div class="blog__meta">
144
+
145
+ <time class="blog__meta-time">2019-01-30</time>
146
+
147
+ <span class="blog__meta-label">注目</span>
148
+
149
+ </div>
150
+
151
+ <p class="blog__ttl">ブログブログブログブログブログ<br>ブログブログブログブログ</p>
152
+
153
+ </li>
154
+
155
+ <li class="blog__item">
156
+
157
+ <div class="blog__meta">
158
+
159
+ <time class="blog__meta-time">2019-01-30</time>
160
+
161
+ <span class="blog__meta-label">注目</span>
162
+
163
+ </div>
164
+
165
+ <p class="blog__ttl">ブログブログブログブログブログ<br>ブログブログブログブログ</p>
166
+
167
+ </li>
168
+
169
+ <li class="blog__item">
170
+
171
+ <div class="blog__meta">
172
+
173
+ <time class="blog__meta-time">2019-01-30</time>
174
+
175
+ <span class="blog__meta-label">注目</span>
176
+
177
+ </div>
178
+
179
+ <p class="blog__ttl">ブログブログブログブログブログ<br>ブログブログブログニュース</p>
180
+
181
+ </li>
182
+
183
+ </ul>
184
+
185
+ </div>
186
+
187
+ </div>
188
+
189
+ </div>
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+ </section>
198
+
199
+ </body>
200
+
201
+
202
+
203
+ </html>
204
+
205
+ ```
206
+
207
+
208
+
209
+ ```ここに言語を入力
210
+
211
+ //-----------------------------------------------------
212
+
213
+ // 変数
214
+
215
+ //-----------------------------------------------------
216
+
217
+ $c-main: #3f51b5;
218
+
219
+ $c-sub: #e81919;
220
+
221
+ $c-section: #efefef;
222
+
223
+
224
+
225
+ $w-pc: 1086px; // PC
226
+
227
+ $w-tab: $w-pc - 1; // タブレット
228
+
229
+ $w-sp: 767px; // スマホ
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+ //-----------------------------------------------------
238
+
239
+ // mixin
240
+
241
+ //-----------------------------------------------------
242
+
243
+ @mixin pc {
244
+
245
+
246
+
247
+ @media (min-width: ($w-pc)) {
248
+
249
+ @content;
250
+
251
+ }
252
+
253
+ }
254
+
255
+
256
+
257
+ @mixin tab {
258
+
259
+
260
+
261
+ @media (max-width: ($w-tab)) {
262
+
263
+ @content;
264
+
265
+ }
266
+
267
+ }
268
+
269
+
270
+
271
+ @mixin sp {
272
+
273
+
274
+
275
+ @media (max-width: ($w-sp)) {
276
+
277
+ @content;
278
+
279
+ }
280
+
281
+ }
282
+
283
+ //-----------------------------------------------------
284
+
285
+ // 共通
286
+
287
+ //-----------------------------------------------------
288
+
289
+ html {
290
+
291
+ font-size: 62.5%;
292
+
293
+ }
294
+
295
+
296
+
297
+ body {
298
+
299
+ font-size: 1.4rem;
300
+
301
+ font-family: "Yu Gothic Medium", "游ゴシック Medium", YuGothic, "游ゴシック体", "ヒラギノ角ゴ Pro W3", "メイリオ", sans-serif;
302
+
303
+ background-color: white;
304
+
305
+ color: #333333;
306
+
307
+ }
308
+
309
+
310
+
311
+ li {
312
+
313
+ list-style: none;
314
+
315
+ }
316
+
317
+
318
+
319
+ a {
320
+
321
+ text-decoration: none;
322
+
323
+ }
324
+
325
+
326
+
327
+ .wrapper {
328
+
329
+ overflow: hidden;
330
+
331
+ }
332
+
333
+ //-----------------------------------------------------
334
+
335
+ // お知らせ
336
+
337
+ //-----------------------------------------------------
338
+
339
+
340
+
341
+ .widget{
342
+
343
+
344
+
345
+ &__inner {
346
+
347
+ margin: 0 auto;
348
+
349
+ max-width: 100%;
350
+
351
+ padding: 0 15px;
352
+
353
+ width: 1050px;
354
+
355
+ display: flex;
356
+
357
+ overflow: hidden;
358
+
359
+
360
+
361
+ @include pc {
362
+
363
+ padding: 0;
364
+
365
+ }
366
+
367
+ @include sp {
368
+
369
+ flex-direction: column;
370
+
371
+ }
372
+
373
+
374
+
375
+ }
376
+
377
+
378
+
379
+
380
+
381
+ }
382
+
11
383
  .news{
12
384
 
13
385
  flex-basis: calc(50% - 8px);
@@ -34,752 +406,352 @@
34
406
 
35
407
 
36
408
 
409
+ background-color: $c-main;
410
+
411
+ padding: 15px 16px 15px 30px;
412
+
413
+
414
+
415
+ &-ttl{
416
+
417
+ color: #ffffff;
418
+
419
+ font-size: 2rem;
420
+
421
+ font-weight: bold;
422
+
423
+ }
424
+
425
+ &-btn{
426
+
427
+ font-weight: bold;
428
+
429
+ border-radius:5px;
430
+
431
+ display: block;
432
+
433
+ text-align: center;
434
+
435
+ width: 100px;
436
+
437
+ height: 30px;
438
+
439
+ line-height: 30px;
440
+
441
+ color:#333333;
442
+
443
+ background-color: #fff;
444
+
445
+ }
446
+
447
+ }
448
+
449
+ &__body{
450
+
451
+ padding: 24px 18px 27px 18.5px;
452
+
453
+ }
454
+
455
+
456
+
457
+ &__item{
458
+
459
+ display: flex;
460
+
461
+ padding: 28.5px 0 10.5px;
462
+
463
+
464
+
465
+ @include sp {
466
+
467
+ flex-direction: column;
468
+
469
+ }
470
+
471
+
472
+
473
+ &:first-child{
474
+
475
+ padding-top: 0;
476
+
477
+ }
478
+
479
+
480
+
481
+ & + &{
482
+
483
+ border-top: 1px solid #707070;
484
+
485
+ }
486
+
487
+
488
+
489
+ }
490
+
491
+
492
+
493
+ &__meta{
494
+
495
+ margin-right: 24px;
496
+
497
+ display: flex;
498
+
499
+ flex-direction: column;
500
+
501
+ font-size: 1.6rem;
502
+
503
+ font-weight: bold;
504
+
505
+
506
+
507
+ @include sp {
508
+
509
+ flex-direction: row;
510
+
511
+ }
512
+
513
+
514
+
515
+ align-items: flex-start;
516
+
517
+
518
+
519
+ &-label{
520
+
521
+ margin-top: 5px;
522
+
523
+ font-size: 1.2rem;
524
+
525
+ background-color: #FEBB07;
526
+
527
+ color: #ffffff;
528
+
529
+ padding: 2px 8px;
530
+
531
+ text-align: center;
532
+
533
+ border-radius: 4px;
534
+
535
+
536
+
537
+ @include sp {
538
+
539
+ margin-left: 20px;
540
+
541
+ margin-top: 0;
542
+
543
+ }
544
+
545
+ }
546
+
547
+ }
548
+
549
+
550
+
551
+ &__ttl{
552
+
553
+ font-size: 1.6rem;
554
+
555
+ flex:1;
556
+
557
+ line-height: 1.625;
558
+
559
+ }
560
+
561
+
562
+
563
+ }
564
+
565
+
566
+
567
+ .blog{
568
+
569
+ flex-basis: calc(50% - 8px);
570
+
571
+ border: 1px solid #B53F6E;
572
+
573
+ border-radius: 4px;
574
+
575
+ margin-right: 16px;
576
+
577
+
578
+
579
+ @include sp{
580
+
581
+ margin-top: 50px;
582
+
583
+ }
584
+
585
+
586
+
587
+ &__header{
588
+
589
+ height: 60px;
590
+
591
+ width: 100%;
592
+
593
+ display: flex;
594
+
595
+ justify-content: space-between;
596
+
597
+
598
+
599
+ background-color: #B53F6E;
600
+
601
+ padding: 15px 16px 15px 30px;
602
+
603
+
604
+
605
+ &-ttl{
606
+
607
+ color: #ffffff;
608
+
609
+ font-size: 2rem;
610
+
611
+ font-weight: bold;
612
+
613
+ }
614
+
615
+ &-btn{
616
+
617
+ font-weight: bold;
618
+
619
+ border-radius:5px;
620
+
621
+ display: block;
622
+
623
+ text-align: center;
624
+
625
+ width: 100px;
626
+
627
+ height: 30px;
628
+
629
+ line-height: 30px;
630
+
631
+ color:#333333;
632
+
633
+ background-color: #fff;
634
+
635
+ }
636
+
637
+ }
638
+
639
+ &__body{
640
+
641
+ padding: 24px 18px 27px 18.5px;
642
+
643
+ }
644
+
645
+
646
+
647
+ &__item{
648
+
649
+ display: flex;
650
+
651
+ padding: 28.5px 0 10.5px;
652
+
653
+
654
+
655
+ @include sp {
656
+
657
+ flex-direction: column;
658
+
659
+ }
660
+
661
+
662
+
663
+ &:first-child{
664
+
665
+ padding-top: 0;
666
+
667
+ }
668
+
669
+
670
+
671
+ & + &{
672
+
673
+ border-top: 1px solid #707070;
674
+
675
+ }
676
+
677
+
678
+
679
+ }
680
+
681
+
682
+
683
+ &__meta{
684
+
685
+ margin-right: 24px;
686
+
687
+ display: flex;
688
+
689
+ flex-direction: column;
690
+
691
+ font-size: 1.6rem;
692
+
693
+ font-weight: bold;
694
+
695
+
696
+
697
+ @include sp {
698
+
699
+ flex-direction: row;
700
+
701
+ }
702
+
703
+
704
+
705
+ align-items: flex-start;
706
+
707
+
708
+
709
+ &-label{
710
+
711
+ margin-top: 5px;
712
+
713
+ font-size: 1.2rem;
714
+
715
+ background-color: #FEBB07;
716
+
717
+ color: #ffffff;
718
+
719
+ padding: 2px 8px;
720
+
721
+ text-align: center;
722
+
723
+ border-radius: 4px;
724
+
725
+
726
+
727
+ @include sp {
728
+
729
+ margin-left: 20px;
730
+
731
+ margin-top: 0;
732
+
733
+ }
734
+
735
+ }
736
+
737
+ }
738
+
739
+
740
+
741
+ &__ttl{
742
+
743
+ font-size: 1.6rem;
744
+
745
+ flex:1;
746
+
747
+ line-height: 1.625;
748
+
749
+ }
750
+
751
+
752
+
753
+ }
754
+
755
+
756
+
37
757
  ```
38
-
39
- ちなみに、図の「おしらせ」と「ブログ」のcssは色以外はほぼ同じ構造ですが、
40
-
41
- 「おしらせ」の方のみこの隙間ができてしまいます。
42
-
43
-
44
-
45
- この隙間の理由がわかる方いらっしゃいましたら、教えていただけないでしょうか?
46
-
47
-
48
-
49
- ちなみに、動作確認はchrome最新バージョン: 77.0.3865.90(Official Build) (64 ビット)
50
-
51
- で行っています。
52
-
53
-
54
-
55
-
56
-
57
- 全てのソースを載せておきます。
58
-
59
- ```ここに言語を入力
60
-
61
- <!DOCTYPE html>
62
-
63
- <html lang="en">
64
-
65
-
66
-
67
- <head>
68
-
69
- <meta charset="UTF-8">
70
-
71
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
72
-
73
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
74
-
75
- <title>Document</title>
76
-
77
- <link rel="stylesheet" href="https://unpkg.com/ress/dist/ress.min.css">
78
-
79
- <link rel="stylesheet" href="css/widget.css">
80
-
81
- </head>
82
-
83
-
84
-
85
- <body>
86
-
87
- <section class="widget section">
88
-
89
- <h3 class="section__ttl">Widget</h3>
90
-
91
- <div class="widget__inner">
92
-
93
- <div class="news">
94
-
95
- <div class="news__header">
96
-
97
- <h4 class="news__header-ttl">おしらせ</h4>
98
-
99
- <a href="#" class="news__header-btn">more...</a>
100
-
101
- </div>
102
-
103
- <div class="news__body">
104
-
105
- <ul class="news__list">
106
-
107
- <li class="news__item">
108
-
109
- <div class="news__meta">
110
-
111
- <time class="news__meta-time">2019-01-30</time>
112
-
113
- <span class="news__meta-label">注目</span>
114
-
115
- </div>
116
-
117
- <p class="news__ttl">ニュースニュースニュースニュースニュース<br>ニュースニュースニュースニュース</p>
118
-
119
- </li>
120
-
121
- <li class="news__item">
122
-
123
- <div class="news__meta">
124
-
125
- <time class="news__meta-time">2019-01-30</time>
126
-
127
- <span class="news__meta-label">注目</span>
128
-
129
- </div>
130
-
131
- <p class="news__ttl">ニュースニュースニュースニュースニュース<br>ニュースニュースニュースニュース</p>
132
-
133
- </li>
134
-
135
- <li class="news__item">
136
-
137
- <div class="news__meta">
138
-
139
- <time class="news__meta-time">2019-01-30</time>
140
-
141
- <span class="news__meta-label">注目</span>
142
-
143
- </div>
144
-
145
- <p class="news__ttl">ニュースニュースニュースニュースニュース<br>ニュースニュースニュースニュース</p>
146
-
147
- </li>
148
-
149
- </ul>
150
-
151
- </div>
152
-
153
- </div>
154
-
155
- <div class="blog">
156
-
157
- <div class="blog__header">
158
-
159
- <h4 class="blog__header-ttl">ブログ</h4>
160
-
161
- <a href="#" class="blog__header-btn">more...</a>
162
-
163
- </div>
164
-
165
- <div class="blog__body">
166
-
167
- <ul class="blog__list">
168
-
169
- <li class="blog__item">
170
-
171
- <div class="blog__meta">
172
-
173
- <time class="blog__meta-time">2019-01-30</time>
174
-
175
- <span class="blog__meta-label">注目</span>
176
-
177
- </div>
178
-
179
- <p class="blog__ttl">ブログブログブログブログブログ<br>ブログブログブログブログ</p>
180
-
181
- </li>
182
-
183
- <li class="blog__item">
184
-
185
- <div class="blog__meta">
186
-
187
- <time class="blog__meta-time">2019-01-30</time>
188
-
189
- <span class="blog__meta-label">注目</span>
190
-
191
- </div>
192
-
193
- <p class="blog__ttl">ブログブログブログブログブログ<br>ブログブログブログブログ</p>
194
-
195
- </li>
196
-
197
- <li class="blog__item">
198
-
199
- <div class="blog__meta">
200
-
201
- <time class="blog__meta-time">2019-01-30</time>
202
-
203
- <span class="blog__meta-label">注目</span>
204
-
205
- </div>
206
-
207
- <p class="blog__ttl">ブログブログブログブログブログ<br>ブログブログブログニュース</p>
208
-
209
- </li>
210
-
211
- </ul>
212
-
213
- </div>
214
-
215
- </div>
216
-
217
- </div>
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
- </section>
226
-
227
- </body>
228
-
229
-
230
-
231
- </html>
232
-
233
- ```
234
-
235
-
236
-
237
- ```ここに言語を入力
238
-
239
- //-----------------------------------------------------
240
-
241
- // 変数
242
-
243
- //-----------------------------------------------------
244
-
245
- $c-main: #3f51b5;
246
-
247
- $c-sub: #e81919;
248
-
249
- $c-section: #efefef;
250
-
251
-
252
-
253
- $w-pc: 1086px; // PC
254
-
255
- $w-tab: $w-pc - 1; // タブレット
256
-
257
- $w-sp: 767px; // スマホ
258
-
259
-
260
-
261
-
262
-
263
-
264
-
265
- //-----------------------------------------------------
266
-
267
- // mixin
268
-
269
- //-----------------------------------------------------
270
-
271
- @mixin pc {
272
-
273
-
274
-
275
- @media (min-width: ($w-pc)) {
276
-
277
- @content;
278
-
279
- }
280
-
281
- }
282
-
283
-
284
-
285
- @mixin tab {
286
-
287
-
288
-
289
- @media (max-width: ($w-tab)) {
290
-
291
- @content;
292
-
293
- }
294
-
295
- }
296
-
297
-
298
-
299
- @mixin sp {
300
-
301
-
302
-
303
- @media (max-width: ($w-sp)) {
304
-
305
- @content;
306
-
307
- }
308
-
309
- }
310
-
311
- //-----------------------------------------------------
312
-
313
- // 共通
314
-
315
- //-----------------------------------------------------
316
-
317
- html {
318
-
319
- font-size: 62.5%;
320
-
321
- }
322
-
323
-
324
-
325
- body {
326
-
327
- font-size: 1.4rem;
328
-
329
- font-family: "Yu Gothic Medium", "游ゴシック Medium", YuGothic, "游ゴシック体", "ヒラギノ角ゴ Pro W3", "メイリオ", sans-serif;
330
-
331
- background-color: white;
332
-
333
- color: #333333;
334
-
335
- }
336
-
337
-
338
-
339
- li {
340
-
341
- list-style: none;
342
-
343
- }
344
-
345
-
346
-
347
- a {
348
-
349
- text-decoration: none;
350
-
351
- }
352
-
353
-
354
-
355
- .wrapper {
356
-
357
- overflow: hidden;
358
-
359
- }
360
-
361
- //-----------------------------------------------------
362
-
363
- // お知らせ
364
-
365
- //-----------------------------------------------------
366
-
367
-
368
-
369
- .widget{
370
-
371
-
372
-
373
- &__inner {
374
-
375
- margin: 0 auto;
376
-
377
- max-width: 100%;
378
-
379
- padding: 0 15px;
380
-
381
- width: 1050px;
382
-
383
- display: flex;
384
-
385
- overflow: hidden;
386
-
387
-
388
-
389
- @include pc {
390
-
391
- padding: 0;
392
-
393
- }
394
-
395
- @include sp {
396
-
397
- flex-direction: column;
398
-
399
- }
400
-
401
-
402
-
403
- }
404
-
405
-
406
-
407
-
408
-
409
- }
410
-
411
- .news{
412
-
413
- flex-basis: calc(50% - 8px);
414
-
415
- border: 1px solid $c-main;
416
-
417
- border-radius: 4px;
418
-
419
- margin-right: 16px;
420
-
421
-
422
-
423
- &__header{
424
-
425
- //width100%を指定しているにも関わらず、若干隙間が空く
426
-
427
- width: 100%;
428
-
429
- height: 60px;
430
-
431
- display: flex;
432
-
433
- justify-content: space-between;
434
-
435
-
436
-
437
- background-color: $c-main;
438
-
439
- padding: 15px 16px 15px 30px;
440
-
441
-
442
-
443
- &-ttl{
444
-
445
- color: #ffffff;
446
-
447
- font-size: 2rem;
448
-
449
- font-weight: bold;
450
-
451
- }
452
-
453
- &-btn{
454
-
455
- font-weight: bold;
456
-
457
- border-radius:5px;
458
-
459
- display: block;
460
-
461
- text-align: center;
462
-
463
- width: 100px;
464
-
465
- height: 30px;
466
-
467
- line-height: 30px;
468
-
469
- color:#333333;
470
-
471
- background-color: #fff;
472
-
473
- }
474
-
475
- }
476
-
477
- &__body{
478
-
479
- padding: 24px 18px 27px 18.5px;
480
-
481
- }
482
-
483
-
484
-
485
- &__item{
486
-
487
- display: flex;
488
-
489
- padding: 28.5px 0 10.5px;
490
-
491
-
492
-
493
- @include sp {
494
-
495
- flex-direction: column;
496
-
497
- }
498
-
499
-
500
-
501
- &:first-child{
502
-
503
- padding-top: 0;
504
-
505
- }
506
-
507
-
508
-
509
- & + &{
510
-
511
- border-top: 1px solid #707070;
512
-
513
- }
514
-
515
-
516
-
517
- }
518
-
519
-
520
-
521
- &__meta{
522
-
523
- margin-right: 24px;
524
-
525
- display: flex;
526
-
527
- flex-direction: column;
528
-
529
- font-size: 1.6rem;
530
-
531
- font-weight: bold;
532
-
533
-
534
-
535
- @include sp {
536
-
537
- flex-direction: row;
538
-
539
- }
540
-
541
-
542
-
543
- align-items: flex-start;
544
-
545
-
546
-
547
- &-label{
548
-
549
- margin-top: 5px;
550
-
551
- font-size: 1.2rem;
552
-
553
- background-color: #FEBB07;
554
-
555
- color: #ffffff;
556
-
557
- padding: 2px 8px;
558
-
559
- text-align: center;
560
-
561
- border-radius: 4px;
562
-
563
-
564
-
565
- @include sp {
566
-
567
- margin-left: 20px;
568
-
569
- margin-top: 0;
570
-
571
- }
572
-
573
- }
574
-
575
- }
576
-
577
-
578
-
579
- &__ttl{
580
-
581
- font-size: 1.6rem;
582
-
583
- flex:1;
584
-
585
- line-height: 1.625;
586
-
587
- }
588
-
589
-
590
-
591
- }
592
-
593
-
594
-
595
- .blog{
596
-
597
- flex-basis: calc(50% - 8px);
598
-
599
- border: 1px solid #B53F6E;
600
-
601
- border-radius: 4px;
602
-
603
- margin-right: 16px;
604
-
605
-
606
-
607
- @include sp{
608
-
609
- margin-top: 50px;
610
-
611
- }
612
-
613
-
614
-
615
- &__header{
616
-
617
- height: 60px;
618
-
619
- width: 100%;
620
-
621
- display: flex;
622
-
623
- justify-content: space-between;
624
-
625
-
626
-
627
- background-color: #B53F6E;
628
-
629
- padding: 15px 16px 15px 30px;
630
-
631
-
632
-
633
- &-ttl{
634
-
635
- color: #ffffff;
636
-
637
- font-size: 2rem;
638
-
639
- font-weight: bold;
640
-
641
- }
642
-
643
- &-btn{
644
-
645
- font-weight: bold;
646
-
647
- border-radius:5px;
648
-
649
- display: block;
650
-
651
- text-align: center;
652
-
653
- width: 100px;
654
-
655
- height: 30px;
656
-
657
- line-height: 30px;
658
-
659
- color:#333333;
660
-
661
- background-color: #fff;
662
-
663
- }
664
-
665
- }
666
-
667
- &__body{
668
-
669
- padding: 24px 18px 27px 18.5px;
670
-
671
- }
672
-
673
-
674
-
675
- &__item{
676
-
677
- display: flex;
678
-
679
- padding: 28.5px 0 10.5px;
680
-
681
-
682
-
683
- @include sp {
684
-
685
- flex-direction: column;
686
-
687
- }
688
-
689
-
690
-
691
- &:first-child{
692
-
693
- padding-top: 0;
694
-
695
- }
696
-
697
-
698
-
699
- & + &{
700
-
701
- border-top: 1px solid #707070;
702
-
703
- }
704
-
705
-
706
-
707
- }
708
-
709
-
710
-
711
- &__meta{
712
-
713
- margin-right: 24px;
714
-
715
- display: flex;
716
-
717
- flex-direction: column;
718
-
719
- font-size: 1.6rem;
720
-
721
- font-weight: bold;
722
-
723
-
724
-
725
- @include sp {
726
-
727
- flex-direction: row;
728
-
729
- }
730
-
731
-
732
-
733
- align-items: flex-start;
734
-
735
-
736
-
737
- &-label{
738
-
739
- margin-top: 5px;
740
-
741
- font-size: 1.2rem;
742
-
743
- background-color: #FEBB07;
744
-
745
- color: #ffffff;
746
-
747
- padding: 2px 8px;
748
-
749
- text-align: center;
750
-
751
- border-radius: 4px;
752
-
753
-
754
-
755
- @include sp {
756
-
757
- margin-left: 20px;
758
-
759
- margin-top: 0;
760
-
761
- }
762
-
763
- }
764
-
765
- }
766
-
767
-
768
-
769
- &__ttl{
770
-
771
- font-size: 1.6rem;
772
-
773
- flex:1;
774
-
775
- line-height: 1.625;
776
-
777
- }
778
-
779
-
780
-
781
- }
782
-
783
-
784
-
785
- ```

1

脱字の修正のため

2019/10/02 14:29

投稿

Silky
Silky

スコア34

test CHANGED
File without changes
test CHANGED
@@ -1,5 +1,7 @@
1
1
  標題の通り、子要素にwidth100%を設定しているのに親要素との間に隙間ができてしまいます。
2
2
 
3
+ (正確には、デベロッパーツールで幅を拡大したり縮小したりすると、隙間ができたりできなかったり、ガタガタします。)
4
+
3
5
  ![イメージ説明](21b83f2f9133ec769eaeb1bbb8a6806e.png)
4
6
 
5
7
  親要素のクラスはnews、子クラスはnews__headerとなります。