When i tried to put a opacity more black in my background for html css that doesn’t work and i asked gpt, also don’t know or giving wrong codes.
I want a background with black color inside, then the image when using opacity, will becoming darkness. And also get a navigation menu(just for looking) with some animations, i was doing that but I can’t leave this part about opacity
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pokemon - Saga!</title>
<link rel="stylesheet" href="../web01/style.css">
</head>
<header>
</header>
<body>
<div class="heading">
<a href="#"> Nossos Pokemons</a>
<a href="#"> Venha ser um treinador</a>
<a href="#"> Quem somos?</a>
<a href="#"> Nossa Loja </a>
</div>
<img src="pokemonimg.jpg" alt="pokemon" class="img">
<div class="overlay">
</div>
</body>
</html>
and then my css
.heading {
text-align: center;
margin-top: 20;
}
.heading {
color: #3995f8;
text-decoration: none;
display: inline-block;
position: fixed;
padding: 10px 20px;
margin-bottom: 600px;
border: 2px solid #007bff;
border-radius: 4px;
transition: all 0.3s ease;
}
body {
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
height: 100vh;
}
.overlay {
position: absolute; /* Coloca a camada de sobreposição sobre a imagem */
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7)
}
selector {
opacity: value;
}
.img {
opacity: 0.7;
}
I’m expecting a very dark opacity and fully background image… but idk wtf isn’t working(sorry i’m back)
Augusto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.