how to put a black overlay on a photo css
.header {
background: rgba(0, 0, 0, 0.5); /* Black color with 50% alpha/opacity */
}
how to put a black overlay on a photo css
.header {
background: rgba(0, 0, 0, 0.5); /* Black color with 50% alpha/opacity */
}
black background overlay filter | black overlay for image css
Exp:
<header>
<img src="https://picsum.photos/id/1036/4608/3072" alt="Placeholder-Image">
<section>
<h1>Heading</h1>
<h2>Just another tech blog.</h2>
<button>Read more.</button>
</section>
</header>
Add This Css:
header img {
width: 100vw;
height: 100vh;
object-fit: cover;
filter: brightness(.4);
}
section {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #fff;
font-family: 'Roboto', sans-serif;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us