Banner Animado

by Slee

HTML

<!doctype html>
<html lang="es">
  <head>
    <meta charset="UTF-8" />
    <title>Banner Animado con Css</title>
    <link rel="stylesheet" href="estilos.css" />
  </head>
  <body>
    <div class="banner">
      <div class="capa"></div>
      <div class="info">
        <h1>Bienvenidos a SLee Dw</h1>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Facere alias
          nobis debitis provident ut odio aperiam quibusdam. Amet, neque, illo.
        </p>
        <a href="#">Leer MĂ s</a>
      </div>
    </div>
  </body>
</html>

CSS

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: sans-serif;
}
.banner {
  width: 100%;
  height: 600px;
  animation: banner 10s infinite linear alternate;
  background-size: 100% 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
@keyframes banner {
  0%,
  20% {
    background-image: url("https://cdn.pixabay.com/photo/2016/08/04/18/16/coffee-1569682_1280.jpg");
  }
  25%,
  45% {
    background-image: url("https://cdn.pixabay.com/photo/2014/12/11/02/56/coffee-563797_1280.jpg");
  }
  50%,
  70% {
    background-image: url("https://cdn.pixabay.com/photo/2015/06/24/01/15/coffee-819362_1280.jpg");
  }
  75%,
  100% {
    background-image: url("https://cdn.pixabay.com/photo/2018/01/31/09/57/coffee-3120750_1280.jpg");
  }
}
.capa {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.6);
}
.info {
  z-index: 1;
  width: 100%;
  max-width: 550px;
  text-align: center;
}
.info h1 {
  color: #fff;
  font-size: 45px;
  margin-bottom: 20px;
  letter-spacing: 1px;
}
.info p {
  color: #c7c7c7;
  line-height: 1.7;
  margin-bottom: 30px;
}
.info a {
  color: #fff;
  text-decoration: none;
  background: #3088e0;
  padding: 16px 37px;
  display: inline-block;
  border-radius: 50px;
}