Pure html css slider - responsive slider
by Zsanett Tamás
HTML
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<div class="wrapper">
<input checked type=radio name="slider" id="slide1" />
<input type=radio name="slider" id="slide2" />
<input type=radio name="slider" id="slide3" />
<input type=radio name="slider" id="slide4" />
<input type=radio name="slider" id="slide5" />
<div class="slider-wrapper">
<div class=inner>
<article>
<div class="info top-left">
<h3>Eye</h3></div>
<img src="https://cdn.pixabay.com/photo/2019/10/18/17/27/eye-4559763__340.jpg" />
</article>
<article>
<div class="info bottom-right">
<h3>Brown</h3></div>
<img src="https://cdn.pixabay.com/photo/2019/10/19/13/00/autumn-forest-4561344__340.jpg" />
</article>
<article>
<div class="info bottom-left">
<h3>Apples</h3></div>
<img src="https://cdn.pixabay.com/photo/2019/10/17/21/17/apple-4557865__340.jpg" />
</article>
<article>
<div class="info top-right">
<h3>Cat</h3></div>
<img src="https://cdn.pixabay.com/photo/2019/10/19/03/58/cat-4560543__340.jpg" />
</article>
<article>
<div class="info bottom-left">
<h3>White</h3></div>
<img src="https://cdn.pixabay.com/photo/2019/10/16/18/52/wild-birds-4555168__340.jpg" />
</article>
</div>
<!-- .inner -->
</div>
<!-- .slider-wrapper -->
<div class="slider-prev-next-control">
<label for=slide1></label>
<label for=slide2></label>
<label for=slide3></label>
<label for=slide4></label>
<label for=slide5></label>
</div>
<!-- .slider-prev-next-control -->
<div class="slider-dot-control">
<label for=slide1></label>
<label for=slide2></label>
<label for=slide3></label>
<label for=slide4></label>
...
CSS
/*---- NUMBER OF SLIDE CONFIGURATION ----*/
.wrapper {
max-width: 60em;
margin: 1em auto;
position: relative;
}
input {
display: none;
}
.inner {
width: 500%;
line-height: 0;
}
article {
width: 20%;
float: left;
position: relative;
}
article img {
width: 100%;
}
/*---- SET UP CONTROL ----*/
.slider-prev-next-control {
height: 50px;
position: absolute;
top: 50%;
width: 100%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
}
.slider-prev-next-control label {
display: none;
width: 40px;
height: 40px;
border-radius: 50%;
background: #fff;
opacity: 0.7;
}
.slider-prev-next-control label:hover {
opacity: 1;
}
.slider-dot-control {
position: absolute;
width: 100%;
bottom: 0;
text-align: center;
}
.slider-dot-control label {
cursor: pointer;
border-radius: 5px;
display: inline-block;
width: 10px;
height: 10px;
background: #bbb;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
}
.slider-dot-control label:hover {
background: #ccc;
border-color: #777;
}
/* Info Box */
.info {
position: absolute;
font-style: italic;
line-height: 20px;
opacity: 0;
color: #000;
text-align: left;
-webkit-transition: all 1000ms ease-out 600ms;
-moz-transition: all 1000ms ease-out 600ms;
transition: all 1000ms ease-out 600ms;
}
.info h3 {
color: #fcfff4;
margin: 0 0 5px;
font-weight: normal;
font-size: 1.5em;
font-style: normal;
}
.info.top-left {
top: 30px;
left: 30px;
}
.info.top-right {
top: 30px;
right: 30px;
}
.info.bottom-left {
bottom: 30px;
left: 30px;
}
.info.bottom-right {
bottom: 30px;
right: 30px;
}
/* Slider Styling */
.slider-wrapper {
width: 100%;
overflow: hidden;
border-radius: 5px;
box-shadow: 1px 1px 4px #666;
background: #fff;
background: #fcfff4;
-webkit-transform: translateZ(0);
...