Skip to content

Commit ac4d93b

Browse files
committed
Add hero Section of page.
1 parent 3f587ae commit ac4d93b

File tree

1 file changed

+136
-0
lines changed

1 file changed

+136
-0
lines changed

starter/06-Components/05-hero.html

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Omnifood Hero Section</title>
7+
<link rel="preconnect" href="https://fonts.googleapis.com" />
8+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9+
<link
10+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Lato&family=Rubik:wght@400;600;700&display=swap"
11+
rel="stylesheet"
12+
/>
13+
<style>
14+
* {
15+
margin: 0;
16+
padding: 0;
17+
box-sizing: border-box;
18+
}
19+
html {
20+
font-family: "Rubik", sans-serif;
21+
color: #444;
22+
}
23+
24+
.container {
25+
margin: 0 auto;
26+
width: 1200px;
27+
}
28+
29+
header {
30+
/* background-color: orangered; */
31+
height: 100vh;
32+
position: relative;
33+
34+
background-image: linear-gradient(
35+
rgba(34, 34, 34, 0.6),
36+
rgba(34, 34, 34, 0.6)
37+
),
38+
url(hero.jpg);
39+
background-size: cover;
40+
color: #fff;
41+
}
42+
43+
nav {
44+
font-size: 20px;
45+
font-weight: 700;
46+
display: flex;
47+
justify-content: space-between;
48+
padding-top: 34px;
49+
/* background-image: linear-gradient(to right, red, blue); */
50+
51+
/* background-color: green; */
52+
}
53+
54+
.header-container {
55+
width: 1200px;
56+
position: absolute;
57+
left: 50%;
58+
top: 50%;
59+
60+
/* In relation to PARENT side */
61+
transform: translate(-50%, -50%);
62+
/* background-color: violet; */
63+
}
64+
65+
.header-container-inner {
66+
width: 50%;
67+
/* background-color: blue; */
68+
}
69+
70+
h1 {
71+
font-size: 52px;
72+
margin-bottom: 32px;
73+
line-height: 1.05;
74+
}
75+
76+
p {
77+
font-size: 20px;
78+
line-height: 1.6;
79+
margin-bottom: 48px;
80+
}
81+
82+
.btn:link,
83+
.btn:visited {
84+
font-size: 20px;
85+
font-weight: 600;
86+
background-color: #e67e22;
87+
color: #fff;
88+
text-decoration: none;
89+
90+
display: inline-block;
91+
padding: 16px 32px;
92+
border-radius: 9px;
93+
}
94+
95+
h2 {
96+
font-size: 44px;
97+
margin-bottom: 48px;
98+
}
99+
100+
section {
101+
padding: 96px 0;
102+
}
103+
</style>
104+
</head>
105+
<body>
106+
<header>
107+
<nav class="container">
108+
<div class="logo">Logo</div>
109+
<div class="navigation">Navigation</div>
110+
</nav>
111+
112+
<div class="header-container">
113+
<div class="header-container-inner">
114+
<h1>A healthy meal delivered to your door, every single day</h1>
115+
<p>
116+
The smart 365-days-per-year food subscription that will make you eat
117+
healthy again. Tailored to your personal tastes and nutritional
118+
needs.
119+
</p>
120+
<a href="#" class="btn">Start eating well</a>
121+
</div>
122+
</div>
123+
</header>
124+
<section>
125+
<div class="container">
126+
<h2>Some random heading</h2>
127+
<p>
128+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Harum porro
129+
animi quod at officia? Cupiditate, praesentium! Consectetur quam sit
130+
amet cupiditate reiciendis suscipit, placeat nulla. Ratione sed veniam
131+
ea soluta!
132+
</p>
133+
</div>
134+
</section>
135+
</body>
136+
</html>

0 commit comments

Comments
 (0)