0

so you can tell by the title that if background image in a div and the position is relative,it won`t show up, the problem is i want the background image animateable so what can i do? here my code

.div1 {
  background-image: url("https://picsum.photos/id/1/200/200");
  height: 90%;
  width: 20%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: absolute;
  top: 10%;
  left: 75%;
  opacity: 0.6;
}
<div class="div1"></div>

and ifposition: relative the image is just gone

Demo Nomp
  • 43
  • 4
  • your code works fine with absolute (if not, you have to update your code with more detail). With relative it won't work as explained in the duplicate – Temani Afif Oct 31 '22 at 10:57

0 Answers0