Css Slider
CSS Slider der kein Javascript brauch
Kommentar abgeben zu diesen Beitrag/Code ?Dann hier klicken
Der hier verwendete Code
<style>
html, body {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
background-color: #2B2D42;
font-family: 'Open Sans', sans-serif;
}
h1,h2 {color:#fff;}
.container {
position: relative;
margin-top: 100px;
width: 100%;
text-align: center;
}
.block {
width: 10%;
height: 300px;
display: inline-block;
background-color: #E83F6F;
cursor: pointer;
position: relative;
transition: width .5s ease-in-out, background-color .5s ease-in-out;
text-align: center;
}
.block:hover {
background-color: #2274A5;
width: 30%;
transition: width .5s ease-in-out, background-color .5s ease-in-out;
}
.block:hover .img-p {
opacity: 1;
transition: opacity .5s .51s ease-in-out;
}
.block:hover .layer {
opacity: .5;
transition: opacity .5s ease-in-out;
}
.img-p {
position: absolute;
font-size: 16px;
opacity: 0;
color: #FFF;
text-align: left;
line-height: 1.6em;
}
.p-container {
width: 80%;
position: relative;
top: 35%;
margin-left: 5%;
}
h1 { color: #fff; }
.image {
background-image: url(https://placeimg.com/640/480/animals);
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
}
.image.fixed {
background-attachment: fixed;
background-position: center center;
background-size: 100% auto;
}
.layer {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
background-color: #000;
width: 100%;
height: 100%;
opacity: 0;
}
@media (max-width: 768px) {
.container {
width: 90%;
margin: 0 auto;
}
.block {
width: 100%;
height: 200px;
transition: height .5s ease-in-out;
}
.block:hover {
width: 100%;
height: 400px;
transition: height .5s ease-in-out;
}
}
@media (min-width: 768px) {
.block { width: 15%; }
}
@media (min-width: 992px) {
.block { width: 10%; }
}
</style>
<div id="css-script-menu">
<div class="css-script-center">
<div class="css-script-clear"></div>
</div>
</div>
<h1 style="margin-top:150px; text-align:center;">Pure CSS Expanding Slideshow Example</h1>
<div class="container">
<h2>Html elements</h2>
<div class="block">
<div class="p-container">
<p class="img-p"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Non fuga, vero ea enim. Nemo voluptas culpa temporibus eius quae sunt. </p>
</div>
</div>
<div class="block">
<div class="p-container">
<p class="img-p"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Non fuga, vero ea enim. Nemo voluptas culpa temporibus eius quae sunt. </p>
</div>
</div>
<div class="block">
<div class="p-container">
<p class="img-p"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Non fuga, vero ea enim. Nemo voluptas culpa temporibus eius quae sunt. </p>
</div>
</div>
<div class="block">
<div class="p-container">
<p class="img-p"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Non fuga, vero ea enim. Nemo voluptas culpa temporibus eius quae sunt. </p>
</div>
</div>
<div class="block">
<div class="p-container">
<p class="img-p"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Non fuga, vero ea enim. Nemo voluptas culpa temporibus eius quae sunt. </p>
</div>
</div>
</div>
<div class="container">
<h2>Images</h2>
<div class="block image">
<div class="layer"></div>
<div class="p-container">
<p class="img-p"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Non fuga, vero ea enim. Nemo voluptas culpa temporibus eius quae sunt. </p>
</div>
</div>
<div class="block image">
<div class="layer"></div>
<div class="p-container">
<p class="img-p"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Non fuga, vero ea enim. Nemo voluptas culpa temporibus eius quae sunt. </p>
</div>
</div>
<div class="block image">
<div class="layer"></div>
<div class="p-container">
<p class="img-p"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Non fuga, vero ea enim. Nemo voluptas on fuga, vero ea enim. Nemo voluptas culpa temporibus eius quae sunt. </p>
</div>
</div>
</div>