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

質問編集履歴

2

CSSが足りていませんでした。追加します。

2020/05/05 04:46

投稿

ft_ft
ft_ft

スコア9

title CHANGED
File without changes
body CHANGED
@@ -61,39 +61,40 @@
61
61
  max-width: 1170px;
62
62
  margin: 0 auto;
63
63
  background: black;
64
- padding:0;
64
+ padding: 0;
65
65
  }
66
66
 
67
- .menu > li {
67
+ .menu>li {
68
68
  font-size: 18px;
69
69
  float: left;
70
- width: 20%;
70
+ width: 20%;
71
+ /* グローバルナビ5つの場合 */
71
72
  height: 60px;
72
73
  line-height: 60px;
73
74
  background: black;
74
- list-style-type:none;
75
+ list-style-type: none;
75
76
  text-align: center;
76
77
  margin: 0 auto;
77
- }
78
+ }
78
79
 
79
80
 
80
- .menu > li a {
81
+ .menu>li a {
81
82
  display: block;
82
83
  color: #fff;
83
84
  }
84
85
 
85
- .menu > li a:hover {
86
+ .menu>li a:hover {
86
87
  color: #999;
87
88
  }
88
89
 
89
90
  ul.menu__second-level {
90
91
  visibility: hidden;
91
92
  opacity: 0;
92
-
93
+
93
94
  }
94
95
 
95
96
 
96
- .menu > li:hover {
97
+ .menu>li:hover {
97
98
  background: #072A24;
98
99
  -webkit-transition: all .5s;
99
100
  transition: all .5s;
@@ -101,8 +102,8 @@
101
102
 
102
103
  .menu__second-level li {
103
104
  border-top: 1px solid #111;
104
-
105
105
 
106
+
106
107
  }
107
108
 
108
109
 
@@ -114,11 +115,64 @@
114
115
  background: #2a1f1f;
115
116
  }
116
117
 
117
- .background{
118
+ .menu__fourth-level li a:hover {
118
- background-color:black;
119
+ background: #1d0f0f;
119
- width:100%;
120
120
  }
121
121
 
122
+
123
+ /* 下矢印 */
124
+
125
+ .init-bottom:after {
126
+ content: '';
127
+ display: inline-block;
128
+ width: 6px;
129
+ height: 6px;
130
+ margin: 0 0 0 15px;
131
+ border-right: 1px solid #fff;
132
+ border-bottom: 1px solid #fff;
133
+ -webkit-transform: rotate(45deg);
134
+ -ms-transform: rotate(45deg);
135
+ transform: rotate(45deg);
136
+ }
137
+
138
+
139
+ /* floatクリア */
140
+ .menu:before,
141
+ .menu:after {
142
+ content: " ";
143
+ display: table;
144
+ }
145
+
146
+ .menu:after {
147
+ clear: both;
148
+ }
149
+
150
+ .menu {
151
+ *zoom: 1;
152
+ }
153
+
154
+ .menu>li.menu__single {
155
+ position: relative;
156
+ }
157
+
158
+ li.menu__single ul.menu__second-level {
159
+ position: absolute;
160
+ top: 40px;
161
+ width: 100%;
162
+ padding: 0;
163
+ list-style-type: none;
164
+ background: #072A24;
165
+ -webkit-transition: all .2s ease;
166
+ transition: all .2s ease;
167
+ z-index: 100
168
+ }
169
+
170
+
171
+ li.menu__single:hover ul.menu__second-level {
172
+ top: 50px;
173
+ visibility: visible;
174
+ opacity: 1;
175
+ }
122
176
  @media screen and (max-width: 480px) {
123
177
 
124
178
  .menu {

1

ご指摘ありがとうございます。<code>で囲みました。

2020/05/05 04:46

投稿

ft_ft
ft_ft

スコア9

title CHANGED
File without changes
body CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ![イメージ説明](47919fb55df971803a5f7cb7187497fb.png)
4
4
  ---html---
5
+
6
+
7
+ ```ここに言語を入力
5
8
  <div class ="background">
6
9
  <ul class="menu">
7
10
  <li><a href="../index.html">ホーム</a></li>
@@ -46,8 +49,11 @@
46
49
  </li>
47
50
  </ul>
48
51
  </div>
52
+ ```
49
53
 
50
54
  --- CSS --------
55
+
56
+ ```ここに言語を入力
51
57
  .menu {
52
58
  position: relative;
53
59
  width: 100%;
@@ -133,4 +139,5 @@
133
139
 
134
140
  .menu__fourth-level li a:hover {
135
141
  background: #1d0f0f;
136
- }
142
+ }
143
+ ```