Skip to content

Commit 52e61de

Browse files
committed
hero component
1 parent 049650b commit 52e61de

File tree

1 file changed

+88
-10
lines changed

1 file changed

+88
-10
lines changed

starter/06-Components/05-hero.html

Lines changed: 88 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,103 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Omifood Hero Section</title>
7-
<style></style>
7+
<link
8+
href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"
9+
rel="stylesheet"
10+
/>
11+
<style>
12+
* {
13+
padding: 0;
14+
margin: 0;
15+
box-sizing: border-box;
16+
}
17+
body {
18+
font-family: "Inter", sans-serif;
19+
}
20+
.container {
21+
margin: 0 auto;
22+
width: 1200px;
23+
}
24+
header {
25+
height: 100vh;
26+
position: relative;
27+
background-image: linear-gradient(
28+
rgba(34, 34, 34, 0.6),
29+
rgba(34, 34, 34, 0.6)
30+
),
31+
url(hero.jpg);
32+
background-size: cover;
33+
color: #fff;
34+
}
35+
nav {
36+
font-size: 20px;
37+
font-weight: 700;
38+
display: flex;
39+
justify-content: space-between;
40+
text-transform: uppercase;
41+
padding-top: 32px;
42+
}
43+
.header-container {
44+
width: 1200px;
45+
position: absolute;
46+
top: 50%;
47+
left: 50%;
48+
transform: translate(-50%, -50%);
49+
}
50+
.header-container-inner {
51+
width: 50%;
52+
}
53+
h1 {
54+
font-size: 52px;
55+
margin-bottom: 32px;
56+
line-height: 1.05;
57+
}
58+
p {
59+
font-size: 20px;
60+
line-height: 1.6;
61+
margin-bottom: 48px;
62+
}
63+
.btn:link,
64+
.btn:visited {
65+
font-size: 20px;
66+
font-weight: 600;
67+
background-color: #e67e22;
68+
color: #fff;
69+
text-decoration: none;
70+
display: inline-block;
71+
padding: 16px 32px;
72+
border-radius: 10px;
73+
}
74+
h2 {
75+
font-size: 44px;
76+
margin-bottom: 48px;
77+
}
78+
section {
79+
padding: 96px 0;
80+
background-color: #f7f7f7;
81+
}
82+
</style>
883
</head>
984
<body>
1085
<header>
11-
<nav>
86+
<nav class="container">
1287
<div>Logo</div>
1388
<div>Navigation</div>
1489
</nav>
15-
<div>
16-
<h1>A Healthy meal delivered to your door,every single day</h1>
17-
<p>
18-
The smart 365-days-per-year food subscription that will make you eat
19-
healthy again. Tailored to your personal tastes and nutritional needs.
20-
</p>
21-
<a href="#">Start eating well</a>
90+
<div class="header-container">
91+
<div class="header-container-inner">
92+
<h1>A Healthy meal delivered to your door,every single day</h1>
93+
<p>
94+
The smart 365-days-per-year food subscription that will make you eat
95+
healthy again. Tailored to your personal tastes and nutritional
96+
needs.
97+
</p>
98+
<a href="#" class="btn">Start eating well</a>
99+
</div>
22100
</div>
23101
</header>
24102
<section>
25-
<div>
103+
<div class="container">
26104
<h2>Some random heading</h2>
27105
<p>
28106
Lorem ipsum dolor sit amet consectetur adipisicing elit.

0 commit comments

Comments
 (0)