Menu.svelte
1.04 KB
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
<script>
import Menuitems from './Menuitems.svelte'
// 메뉴 바 항목들
const navItems = [
{ label: "Article1", href: "#article1" },
{ label: "Article2", href: "#article2" },
{ label: "Article3", href: "#article3" },
{ label: "Article4", href: "#article4" }
];
</script>
<style>
nav {
background-color: rgb(225, 175, 85);
font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
height: 70px;
top: 0;
}
.inner {
max-width: 500px;
padding-left: 10px;
padding-right: 10px;
margin: auto;
box-sizing: border-box;
display: flex;
align-items: center;
height: 100%;
}
.logo {
display: flex;
position: absolute;
width: 50px;
left: 40px;
top: 25px
}
.navbar-list {
display: flex;
padding: 0;
width: 100%;
justify-content: space-between;
margin: 0;
}
</style>
<nav>
<div class="logo">Logo</div>
<div class="inner">
<ul class='navbar-list'>
{#each navItems as item}
<Menuitems {item}/>
{/each}
</ul>
</div>
</nav>