-1
I’m trying to make this image responsive with background cover, but the image is not showing, I tested on H1 to see if it was css, but I don’t know where the error.
#imagem {
background: url(https://i.imgur.com/Y7V4zrd.png) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
h1{
color: chartreuse;
}
<div id="imagem"></div>
<h1>TEXTO</h1>
I know the cover property is the most effective way to make the image responsive so I’m trying to use it.
Thanks vlw, I just didn’t understand where I went wrong, I tried harder I didn’t find.
– Vini
You opened the div and closed right after, putting nothing inside it, so your background was not visible, as your div contained nothing. What I did was just put the lock on your div after the H1 tag.
– João Monteiro
vlw accepted the answer
– Vini