forked from geoffreycrofte/flexbox.ninja
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
150 lines (142 loc) · 3.04 KB
/
demo.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Responsive Website header solved by flexbox - Flexbox.ninja</title>
<meta name="viewport" content="initial-scale=1.0; width=device-width">
<style type="text/css">
* {
box-sizing: border-box;
}
::-moz-selection {
background: #F34A4E;
color: #FFF;
}
::selection {
background: #F34A4E;
color: #FFF;
}
html, body {
margin: 0;
padding: 0;
font-family: sans-serif;
font-size: 1em;
line-height: 1.5;
color: #F34A4E;
background: #FED0D1;
}
.sr-only {
clip: rect(1px, 1px, 1px, 1px);
position: absolute;
height: 1px;
width: 1px;
overflow: hidden;
}
.main-header {
background: #FFF;
box-shadow: 0 1px 6px rgba(0,0,0,.1);
}
.mh-logo {
margin: 0 0 -10px;
}
.main-nav a {
font-size: 0.75em;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 0.1em;
color: #343534;
text-decoration: none;
}
.main-nav ul {
margin: 0;
padding: 0;
}
.center {
margin-top: 4em;
text-align: center;
}
.center a {
display: inline-block;
text-decoration: none;
text-transform: uppercase;
font-weight: bold;
letter-spacing: 0.1em;
color: #F34A4E;
border-bottom: 1px solid #F34A4E;
transition: all .275s;
}
.center a:hover,
.center a:focus {
opacity: 0.8;
padding-bottom: 2px;
border-bottom-color: rgba(243, 74, 95, .5);
}
/**
* Flex & layout things:
* — Mobile first
* — Responsive
*/
img {
max-width: 100%;
height: auto;
}
.container {
width: 960px;
max-width: 100%;
padding: 20px;
margin: 0 auto;
}
.main-header .container {
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
}
.main-nav ul {
margin: 1em 0 .5em;
text-align: center;
}
.main-nav li {
display: inline;
}
.main-nav a {
display: inline-block;
padding: .5em 1.5em;
}
@media (min-width:960px) {
.main-header .container {
justify-content: space-between;
}
}
</style>
</head>
<body>
<h1 class="sr-only">Responsive Header with left logo and right menu</h1>
<header class="main-header">
<div class="container">
<h1 class="mh-logo">
<img src="https://flexbox.ninja/assets/images/logo-flexbox-ninja.png" srcset="https://flexbox.ninja/assets/images/logo-flexbox-ninja.svg 1x, https://flexbox.ninja/assets/images/logo-flexbox-ninja.svg 2x" width="119" height="50" alt="Flexbox Demo">
</h1>
<nav class="main-nav">
<ul class="main-nav-list">
<li>
<a href="#">Home</a>
</li>
<li>
<a href="#">About us</a>
</li>
<li>
<a href="#">Our clients</a>
</li>
<li>
<a href="#">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<footer>
<p class="center"><a href="https://flexbox.ninja/demos/website-header/">Back to the article</a></p>
</footer>
</body>
</html>