I'm attempting to code a webpage from scratch and I'm stumped on how or where to adjust the opacity on the background-image
URL without affecting the text on top.
I thought about giving the background-image
its own class but I'm kind of confused about where this would go.
* {
margin: 0;
padding: 0;
font-family: 'Poppins', sans-serif;
}
.header {
min-height: 100vh;
width: 100%;
background-image: url(images/lake.jpg);
background-position: center;
background-size: cover;
position: relative;
}
nav {
display: flex;
padding: 2% 6%;
justify-content: space-between;
align-items: center;
}
nav img {
width: 300px;
}
.logo {
width: 0%;
height: 0%;
display: block;
}
.navbar {
flex: 1;
text-align: right;
}
.navbar ul li {
list-style: none;
display: inline-block;
padding: 8px 12px;
position: relative;
}
<section class="header">
<nav>
<div class="logo">
<a href="index.html"><img src="https://cdn.pixabay.com/photo/2022/10/23/09/07/bicycle-7540835_960_720.png"></a>
</div>
<div class="navbar">
<ul>
<li><a href="">Home</a></li>
<li><a href="">About Me</a></li>
<li><a href="">Portfolio</a></li>
<li><a href="">Contact</a></li>
</ul>
</div>
</nav>
</section>