Slider Green

<!DOCTYPE html>
<html>
<head>
<title>Slider</title>
</head>
<body>
<section class="slider">
<input type="radio" name="slide" class="radio1" checked="checked">
<input type="radio" name="slide" class="radio2">
<input type="radio" name="slide" class="radio3">
<div class="slide"></div>
</section>
</body>
</html>
<style type="text/css">
body{margin: 0px;padding: 0px;font-family: arial;}
.slider{
position: absolute;
width: 100%;
height: 100%;
background: #333;
overflow: hidden;
display: flex;
justify-content: center;
align-items: flex-end;
}
.slider input[type="radio"]{
position: relative;
z-index: 1;
margin-bottom:40px;
outline: none;
cursor: pointer;
}
.slider .slide{
position: absolute;
top: 0px;
left: 0px;
width: 200%;
height: 100%;
background:url(slider.jpg);
transition: 1s;
background-size: cover;
}
.slider input[type="radio"].radio1:checked ~ .slide{
background-position-x:0;
}
.slider input[type="radio"].radio2:checked ~ .slide{
background-position-x:-780px;
}
.slider input[type="radio"].radio3:checked ~ .slide{
background-position-x:-1360px;
}
</style>

Comments

Popular posts from this blog

Right click disable

Moutain

Input Placeholder