I have spent hours on this wasteful exercise. I am unable to set the color of text over the image to be perfect white. It takes on the color of what's behind it. Please take a look.
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@100;300;400;700;900&display=swap');
html {
scroll-behavior: smooth;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
margin: 0;
overflow-x: auto;
overflow-y: scroll;
font-family: 'Lato';
}
header {
background-color: #e8e9ea;
padding: 10px 0;
}
.nav-container {
width: 85%;
margin: 0 auto;
}
nav {
margin: 30px 0;
display: flex;
justify-content: space-between;
align-items: center;
}
.nav-top {
margin: 15px 0;
}
.nav-brand {
font-size: 1.8rem;
font-weight: 300;
}
ul {
list-style-type: none;
}
ul li {
display: inline-block;
margin: 0 8px;
font-size: 14px;
font-weight: 300;
}
li a {
text-decoration: none;
color: black;
}
.container {
width: 85%;
margin: 0 auto;
}
.mb_parallax_container {
margin-top: 100px;
height: 100vh;
width: 100%;
background-attachment: fixed;
background-size: cover;
background-repeat: no-repeat;
background-image: url(https://i.ibb.co/q50nfZ1/Woman-visiting-psychologist-office-Patient-sitting-in-armchair-and-talking-to-psychiatrist-Vector-il.jpg);
background-position: center;
position: relative;
z-index: 1;
}
.mb_parallax_overlay {
height: 100vh;
width: 100%;
background-color: black;
opacity: .4;
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
position: relative;
z-index: 2;
}
.mb_parallax_caption {
text-align: center;
width: 70%;
position: relative;
z-index: 3;
opacity: 1;
-webkit-user-select: none;
/* Chrome all / Safari all */
-moz-user-select: none;
/* Firefox all */
-ms-user-select: none;
/* IE 10+ */
user-select: none;
}
.mb_parallax_caption h1 {
font-size: 5.5rem;
color: white;
margin: 20px 0;
}
.mb_parallax_caption p {
margin: 20px 0;
color: white;
font-size: 1.6rem;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css" />
<title>Document</title>
</head>
<body>
<header>
<div class="nav-container">
<div class="nav-top"></div>
<hr>
<nav>
<h3 class="nav-brand">Hello Therapy</h3>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Therapist Repository</a></li>
<li><a href="#">Crisis Intervention</a></li>
<li><a href="#">Resources</a></li>
<li><a href="#">Join Us</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">More</a></li>
</ul>
</nav>
</div>
</header>
<div class="container">
<div class="mb_parallax_container" id="mb_parallax_one">
<div class="mb_parallax_overlay">
<div class="mb_parallax_caption">
<h1>Welcome to Hello Therapy</h1>
<p>Making Therapy Accessible</p>
</div>
</div>
</div>
</div>
</body>
</html>
It would be great if someone could find a work around. Thanks in advance.