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

回答編集履歴

2

コード追記

2021/02/18 07:44

投稿

hatena19
hatena19

スコア34367

answer CHANGED
@@ -34,4 +34,38 @@
34
34
  width:100%;
35
35
  height:100%;
36
36
  }
37
+ ```
38
+
39
+ ---
40
+ テキストはフッター全体の中央、
41
+ インスタグラムアイコンは右から指定位置にする場合
42
+
43
+
44
+ ```css
45
+ #footer {
46
+ width: 100%;
47
+ height: 100px;
48
+ background-color: aqua;
49
+ display: flex;
50
+ justify-content: center;
51
+ align-items: center;
52
+ position: relative;
53
+ }
54
+ .footer-text {
55
+ color: #2F4F4F;
56
+ text-align: center;
57
+ }
58
+ #footer h1 {
59
+ width:40px;
60
+ height:40px;
61
+ position: absolute;
62
+ top: 50%;
63
+ right: 20px;
64
+ transform: translateY(-50%);
65
+ margin: 0;
66
+ }
67
+ .instagram{
68
+ width:100%;
69
+ height:100%;
70
+ }
37
71
  ```

1

コード追記

2021/02/18 07:44

投稿

hatena19
hatena19

スコア34367

answer CHANGED
@@ -10,4 +10,28 @@
10
10
  }
11
11
  ```
12
12
 
13
- float を使わずに flex でレイアウトすれば悩まずにすみますね。
13
+ float を使わずに flex でレイアウトすれば悩まずにすみますね。
14
+ テキストとアイコンを上下中央配置にするならば、
15
+
16
+ ```css
17
+ #footer {
18
+ width: 100%;
19
+ height: 100px;
20
+ background-color: aqua;
21
+ display: flex;
22
+ align-items: center;
23
+ justify-content: space-between;
24
+ }
25
+ .footer-text {
26
+ color: #2F4F4F;
27
+ text-align: center;
28
+ }
29
+ #footer h1 {
30
+ width:40px;
31
+ height:40px;
32
+ }
33
+ .instagram{
34
+ width:100%;
35
+ height:100%;
36
+ }
37
+ ```