1
Hi, I need some help from the community. I have an example of an image with overlay text, the image should be somewhat opaque with the black background, as in the example, but the text should not be opaque. It works like this, no "Hover".
https://jsfiddle.net/qrco3g78/
div {
max-width: 200px;
max-height: 200px;
text-align: center;
background: black;
border-radius:7px;
}
h2 {
color: white;
font-weight: bold;
font-family: Arial;
text-transform: uppercase;
height: 200px;
margin-bottom: -270px;
padding-top: 35%;
}
figure {
margin: 0;
opacity: .8;
}
a {
text-decoration: none;
}
img {
max-width:200px;
max-height:200px;
border-radius:7px;
}
<div>
<h2>Overlay</h2>
<figure>
<a href="http://#" target="_self"><img src="http://www.dominiopublico.gov.br/download/imagem/go000008.jpg"></a>
</figure>
</div>
Wow, bro. I had tried this several times only with z-index. Missed position. Valeuuuu!
– Geahn Machado
@Geahnmachado good that solved! If you think the Question has been solved do not forget to mark it as accepted not to stay open on the site. Just click on this icon next to the arrows :) ✔
– hugocsl