jeudi 15 février 2018

Adding text next to slideshow images

this is a code I modified it a little bit to make a simple slideshow with images using only HTML and CSS:

(This is a part of the code to see it all please click on demo)

Code:

.slideshow {
  width: 800px;
  margin: 0 auto;
  overflow: hidden;
  border: solid 1px white;
}

.slideshow-container {
  width: 2500px;
  font-size: 0;
  transition: 1s ease;
  height: 225px;
}

@keyframes slide {
  0% {
    transform: translateX(0%);
  }
  12.5% {
    transform: translateX(0%);
  }
  25% {
    transform: translateX(-25%);
  }
  37.5% {
    transform: translateX(-25%);
  }
  50% {
    transform: translateX(-50%);
  }
  62.5% {
    transform: translateX(-50%);
  }
  75% {
    transform: translateX(-75%);
  }
  87.5% {
    transform: translateX(-75%);
  }
  99% {
    transform: translateX(-75%);
  }
  100% {
    transform: translateX(0);
  }
}
<section class="slideshow">
  <div class="slideshow-container slide">
    <img src="http://placeimg.com/625/225/any" />
    <img src="http://placeimg.com/625/225/animals" />
    <img src="http://placeimg.com/625/225/arch" />
  </div>
</section>

demo

I want to add a text next to each image, so in the frame I will have half of it image and the other half text. How can I achieve that?

Thank you




Aucun commentaire:

Enregistrer un commentaire