<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Omnifoood Hero Section</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Rubik:wght@400;500;700&display=swap"
rel="stylesheet"
/>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-family: "Rubik", sans-serif;
color: #444;
}
.container {
margin: 0 auto;
width: 1200px;
}
header {
/* background-color: orangered; */
height: 100vh;
position: relative;
background-image: linear-gradient(
rgba(34, 34, 34, 0.6),
rgba(34, 34, 34, 0.6)
),
url(https://images.unsplash.com/photo-1533777857889-4be7c70b33f7?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=870&q=80); /* inear gradient darknest the image */
background-size: cover; /* figure out automatically the exact size the image to be to cover the entire element */
color: white;
}
nav {
font-size: 20px;
font-weight: 700;
display: flex;
justify-content: space-between;
padding-top: 32px;
/* background-image: linear-gradient(to right, red, blue); */
/* background-color: green; */
}
.header-container {
width: 1200px;
position: absolute;
/* In relation to Parent size */
left: 50%;
top: 50%;
/* In relation to the Element size */
transform: translate(-50%, -50%);
/* background-color: violet; */
/* text-align: center; */
}
.header-container-inner {
width: 50%;
/* background-color: blue; */
}
h1 {
font-size: 52px;
margin-bottom: 32px;
line-height: 1.05;
}
p {
font-size: 20px;
line-height: 1.6;
margin-bottom: 48px;
}
.btn:link,
.btn:visited {
font-size: 20px;
font-weight: 600;
/* background-color: #e67e22; */
color: #fff;
text-decoration: none;
display: inline-block;
padding: 16px 32px;
border-radius: 9px;
}
h2 {
font-size: 44px;
margin-bottom: 48px;
}
section {
padding: 96px 0;
background-color: #f7f7f7;
}
</style>
</head>
<body>
<header>
<nav class="container">
<div>LOGO</div>
<div>NAVIGATION</div>
</nav>
<div class="header-container">
<div class="header-container-inner">
<h1>A healthy meal delivered to your door, every single day</h1>
<p>
The smart 365-days-per-year food subscription that will make you eat
healthy again. Tailored to your personal tastes and nutritional
needs
</p>
<a href="#" class="btn">Start eating well</a>
</div>
</div>
</header>
<section>
<div class="container">
<h2>Some random heading</h2>
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Cumque,
ratione provident quo nisi velit ullam placeat minus tempora deleniti
quasi praesentium quaerat, quae commodi amet dolores nobis, sed
perferendis veritatis.
</p>
</div>
</section>
</body>
</html>
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.