回答編集履歴

1

説明追記

2020/03/03 06:57

投稿

hatena19
hatena19

スコア33742

test CHANGED
@@ -8,9 +8,9 @@
8
8
 
9
9
  .posts a {
10
10
 
11
+ display: flex;
12
+
11
13
  height:100%;
12
-
13
- display: flex;
14
14
 
15
15
  justify-content: center;
16
16
 
@@ -19,3 +19,15 @@
19
19
  }
20
20
 
21
21
  ```
22
+
23
+
24
+
25
+ flex を設定することてブロック要素になるので幅は親要素一杯に広がります。
26
+
27
+ 高さは 100% として親要素の高さに広げます。
28
+
29
+ justify-content: center; で左右中央寄せ
30
+
31
+ align-items: center; で上下中央寄せ
32
+
33
+ です。