Skip to content

Commit cfaf290

Browse files
committed
ch. 96: Building a Hero Section - Part 2
1 parent 6328695 commit cfaf290

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

starter/06-Components/05-hero.html

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,37 @@
3030
}
3131

3232
header {
33-
background-color: orangered;
3433
height: 100vh;
34+
position: relative;
35+
background-image: linear-gradient(rgba(34, 34, 34, 0.6), rgba(34, 34, 34, 0.6)), url(hero.jpg);
36+
background-size: cover;
37+
color: white;
3538
}
3639

3740
nav {
3841
font-size: 20px;
3942
font-weight: 700;
4043
display: flex;
4144
justify-content: space-between;
42-
background-color: green;
45+
padding-top: 32px;
46+
}
47+
48+
.header-container {
49+
width: 1200px;
50+
position: absolute;
51+
left: 50%;
52+
top: 50%;
53+
transform: translate(-50%, -50%);
54+
}
55+
56+
.header-container-inner {
57+
width: 50%;
4358
}
4459

4560
h1 {
4661
font-size: 52px;
4762
margin-bottom: 32px;
63+
line-height: 1.05;
4864
}
4965

5066
p {
@@ -83,11 +99,13 @@
8399
<div>LOGO</div>
84100
<div>NAVIGATION</div>
85101
</nav>
86-
<div class="container">
87-
<h1>A healthy meal delivered to your door, every single day</h1>
88-
<p>The smart 365-days-per-year food subscription that will make you eat healthy again. Tailored to your
89-
personal teastes and nutritional needs.</p>
90-
<a href="#" class="btn">Start eating well</a>
102+
<div class="header-container">
103+
<div class="header-container-inner">
104+
<h1>A healthy meal delivered to your door, every single day</h1>
105+
<p>The smart 365-days-per-year food subscription that will make you eat healthy again. Tailored to your
106+
personal teastes and nutritional needs.</p>
107+
<a href="#" class="btn">Start eating well</a>
108+
</div>
91109
</div>
92110
</header>
93111
<section>

0 commit comments

Comments
 (0)