F
F
Fargoth2018-07-25 11:26:30
css
Fargoth, 2018-07-25 11:26:30

How to fix background animation inside div?

Changing the background image inside a div doesn't work. And it is in a specific div'e. If you reduce the width and height, then it works. What can be wrong?

.bgpic {
  background-image:url(2.png);
    background-repeat: no-repeat;
    box-shadow: black 1px 1px 1px;
    height: 55em;
  width: 100%;
  background-size: cover;
}
.bgpic:after {
    content: '';
  height: 55em;
  transition: opacity .5s ease-in;
  position: absolute;
  left: 0; top: 0;
  background:url(4.jpg);
  animation: foo 10s infinite;
}
@keyframes bgpic {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2018-07-25
@Fargoth

https://jsfiddle.net/e87axpzb/9/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question