<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
body
{
margin: 0;
padding: 0;
font-family: sans-serif;
}
.container
{
position: relative;
overflow: hidden;
width: 100%;
height: 100vh;
}
.container .slider
{
position: absolute;
top: 0;
left: 0;
width: 500%;
height: 100%;
animation: animate 10s linear infinite;
}
.container .slider .slide
{
position: relative;
width: 20%;
height: 100%;
float: left;
}
.container .slider .slide .caption
{
position: absolute;
bottom: 60px;
left: 60px;
right: 60px;
padding: 30px;
background: rgba(0,0,0,.5);
box-sizing: border-box;
transition: 0.5s;
}
.container .slider .slide .caption h2
{
margin: 0 0 20px;
padding: 0;
color: #fff;
font-size: 48px;
transition: 0.5s;
}
.container .slider .slide .caption p
{
margin: 0;
padding: 0;
color: #fff;
font-size: 18px;
transition: 0.5s;
}
.container .slider .slide.slide1
{
background: url(img1.jpg);
background-size: cover;
background-position: center;
}
.container .slider .slide.slide2
{
background: url(img2.jpg);
background-size: cover;
background-position: center;
}
.container .slider .slide.slide3
{
background: url(img3.jpg);
background-size: cover;
background-position: center;
}
.container .slider .slide.slide4
{
background: url(img4.jpg);
background-size: cover;
background-position: center;
}
@keyframes animate
{
0%
{
left: 0;
}
20%
{
left: 0;
}
25%
{
left: -100%;
}
45%
{
left: -100%;
}
50%
{
left: -200%;
}
70%
{
left: -200%;
}
75%
{
left: -300%;
}
95%
{
left: -300%;
}
100%
{
left: -400%;
}
}
@media (max-width: 768px)
{
.container .slider .slide .caption
{
bottom: 20px;
left: 20px;
right: 20px;
padding: 20px;
}
.container .slider .slide .caption h2
{
margin: 0 0 10px;
font-size: 30px;
}
.container .slider .slide .caption p
{
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="container">
<div class="slider">
<div class="slide slide1">
<div class="caption">
<h2>Slide1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.</p>
</div>
</div>
<div class="slide slide2">
<div class="caption">
<h2>Slide2</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.</p>
</div>
</div>
<div class="slide slide3">
<div class="caption">
<h2>Slide3</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.</p>
</div>
</div>
<div class="slide slide4">
<div class="caption">
<h2>Slide4</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.</p>
</div>
</div>
<div class="slide slide1">
<div class="caption">
<h2>Slide1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.</p>
</div>
</div>
</div>
</div>
</body>
</html>