UPDATE
Here is a sample code snippet in HTML5.
Personally, I recommend refraining from using the marquee tag.
HTML
<div id="captioned-gallery">
<figure class="slider">
<figure>
<img src="http://lorempixel.com/900/50" />
<figcaption>1</figcaption>
</figure>
<figure>
<img src="http://lorempixel.com/900/50" />
<figcaption>2</figcaption>
</figure>
<figure>
<img src="http://lorempixel.com/900/50" />
<figcaption>3</figcaption>
</figure>
<figure>
<img src="http://lorempixel.com/900/50" />
<figcaption>4</figcaption>
</figure>
<figure>
<img src="http://lorempixel.com/900/50" />
<figcaption>5</figcaption>
</figure>
</figure>
</div>
CSS
@keyframes slidy {
20% { left: 0%; }
25% { left: -100%; }
45% { left: -100%; }
50% { left: -200%; }
70% { left: -200%; }
75% { left: -300%; }
95% { left: -300%; }
100% { left: -400%; }
}
body { margin: 0; }
div#slider {
margin: auto;
width: 80%;
max-width: 900px;
border: solid 4px white;
overflow: hidden; }
div#slider figure {
position: relative;
width: 500%;
margin: 0;
left: 0;
font-size: 0;
animation: 30s slidy infinite; }
div#captioned-gallery { width: 100%; overflow: hidden; }
figure { margin: 0; }
figure.slider {
position: relative; width: 500%;
font-size: 0; animation: 30s slidy infinite; }
figure.slider figure {
width: 20%; height: auto;
display: inline-block;
position: inherit; }
@media screen and (max-width: 500px) {
figure.slider figure figcaption { font-size: 1.2rem; }
}
figure.slider figure figcaption {
position: absolute; bottom: -3.5rem;
background: rgba(0,0,0,0.3);
color: #fff; width: 100%;
font-size: 2rem; padding: .6rem;
transition: .5s bottom; }
figure.slider figure:hover figcaption { bottom: 0; }
https://jsfiddle.net/5xrbmaxo/3/