I'm looking to create a header with a background image that appears twice, like this:
To achieve the effect, I added opacity of 0.5 to one of the images, but it is affecting everything in my header including text and logo. Is there a way to prevent the text and logo from being affected by the opacity applied to the header banner?
/* Styling for marketing business main header */
.marketing-navbar_items {
font-family: Helvetica Neue;
font-size: 30px;
font-weight: normal;
color: #FFFFFF;
}
.marketing-main-header_banner {
background-image: url("https://svgshare.com/i/8KR.svg");
background-size: auto 1199px;
background-repeat: no-repeat;
background-position: center -250px;
position: relative;
height: 949px;
}
.sample {
background-image: url("https://svgshare.com/i/8KR.svg");
background-size: auto 1199px;
background-repeat: no-repeat;
background-position: center -250px;
position: absolute;
height: 949px;
opacity: 0.5;
}
.marketing-main-header_details {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
margin-top: 30px;
}
.marketing-main-header_description p {
font-size: 30px;
font-family: HeaderFont;
color: white;
/* width: 55%; */
text-align: center;
margin: 50px 0px;
}
.marketing-main-header_button-primary {
background-color: white;
background-size: 150px 100px;
font-size: 16px;
border-color: transparent;
color: #4834D4;
font-family: Roboto Regular;
width: 373px;
height: 92px;
}
.marketing-main-header_button {
margin-top: 50px;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<div class="container-fluid marketing-main-header">
<div class="marketing-main-header_banner">
<div class="sample">
<nav class="navbar navbar-expand-lg navbar-light">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto marketing-navbar">
<li class="marketing-navbar_items nav-item">
<a class="marketing-nav-link nav-link" href="#">Dla kogo </a>
</li>
<li class="marketing-navbar_items nav-item">
<a class="marketing-nav-link nav-link" href="#">Agenda</a>
</li>
<li class="marketing-navbar_items nav-item">
<a class="marketing-nav-link nav-link" href="#">Prowadzacy</a>
</li>
<li class="marketing-navbar_items nav-item">
<a class=" marketing-nav-link nav-link " href="#">Faq</a>
</li>
<li class="marketing-navbar_items nav-item">
<a class="marketing-nav-link nav-link " href="#">Kontakt</a>
</li>
<li class="marketing-navbar_items nav-item">
<a class="marketing-nav-link nav-link " href="#">Kompetencje</a>
</li>
</ul>
</div>
</nav>
<div class="marketing-main-header_details">
<div class="marketing-main-header_logo">
<img src="https://thumb.ibb.co/hPrhZp/logo_mib.png">
</div>
<div class="marketing-main-header_title">
<h1>SZKOLENIA</h1>
</div>
<div class="marketing-main-header_description">
<p>Lorem ipsum dolor sit amet, an pro dicta maiorum recusabo.</p>
</div>
<div class="marketing-main-header_sub-description">
<p>Lorem ipsum dolor sit amet, an pro dicta maiorum recusabo.</p>
</div>
<div class="marketing-main-header_button">
<button type="button" class="marketing-main-header_button-primary">Poznaj Agende</button>
</div>
</div>
</div>
</div>
</div>
Is there a way to make sure the text is not affected by the opacity set on the header background image?