-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflexbox-nav-exercise.html
More file actions
87 lines (79 loc) · 2.14 KB
/
flexbox-nav-exercise.html
File metadata and controls
87 lines (79 loc) · 2.14 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example Nav</title>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&family=Work+Sans:wght@800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
}
nav {
height: 4.25em;
background: lightgray;
}
nav ul {
display: flex;
align-items: center;
list-style: none;
margin: 0;
padding: 0;
height: 100%;
}
nav li:not(.logo) {
padding: 1em;
}
.logo {
margin: 0 auto;
font-size: 3em;
font-family: 'Montserrat', sans-serif;
}
nav li {
font-family: 'Work Sans', sans-serif;
font-weight: 800;
}
nav a {
color: black;
text-decoration: none;
}
nav a:hover {
color: blue;
}
/* BONUS */
nav ul {
position: relative;
}
nav li:nth-child(4) {
margin-right: auto;
}
.logo {
height: 100%;
width: 100%;
position: absolute;
text-align: center;
}
nav li:not(.logo) {
z-index: 1;
}
</style>
</head>
<body>
<nav>
<ul>
<li><a href="#">Articles</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Market</a></li>
<li><a href="#">Jobs</a></li>
<li class="logo"><a href="#">Logo</a></li>
<li><a href="#">Follow Us</a></li>
<li><a href="#"><i class="fa fa-search"></i></a></li>
<li><a href="#"><i class="fa fa-shopping-cart"></i></a></li>
<li><a href="#"><i class="fa fa-user-circle"></i></a></li>
</ul>
</nav>
</body>
</html>