-
Notifications
You must be signed in to change notification settings - Fork 0
/
CSS_challenge1_navbar.html
103 lines (100 loc) · 2.55 KB
/
CSS_challenge1_navbar.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nav_Bar</title>
<style>
body{
margin: 0 auto;
}
.nav_Bar{
position: relative;
padding: 0;
height: 55px;
width: 100vw;
background-color: rgb(43, 43, 43);
}
.nav_Bar_list{
height: 55px;
width: 100vw;
margin: 0;
padding: 0;
}
.nav_Bar li{
display: inline-block;
list-style-type: none;
text-align: center;
height: 55px;
width: 55px;
background-color: rgb(43, 43, 43);
}
.nav_Bar li>a{
display: inline-block;
text-decoration: none;
margin-top: 20px;
color: white;
}
.nav_Bar li:nth-child(1){
background-color: rgb(0, 207, 0);
}
.nav_Bar li:nth-child(n):hover{
background-color: rgb(168, 168, 168);
}
.nav_Bar li:nth-child(1):hover{
background-color: rgb(0, 96, 0)
}
#menu-toggle{
display: none;
}
label{
display: none;
}
@media screen and (max-width: 600px){
.nav_Bar_list li{
display: none;
width: 100%;
}
#menu-toggle:checked ~ .nav_Bar_list li{
display: block;
}
#menu-toggle:checked ~ .nav_Bar_list{
display: inline-block;
position: absolute;
left: 24%;
top: 55px;
width: 50%;
}
label{
display: inline-block;
width: 55px;
height: 55px;
color:white;
text-align: center;
position: absolute;
right: 45.5%;
}
}
</style>
</head>
<body>
<nav class="nav_Bar">
<input type="checkbox" id="menu-toggle">
<label for="menu-toggle">Menu</label>
<ul class="nav_Bar_list">
<li>
<a href="#">홈</a>
</li>
<li>
<a href="#">소개</a>
</li>
<li>
<a href="#">서비스</a>
</li>
<li>
<a href="#">문의</a>
</li>
</ul>
</nav>
</body>
</html>