Pure CSS3 Carousel (No Javascript)

Size
2,230 Kb
Views
54,648

How do I make an pure css3 carousel (no javascript)?

An easy carousel made without js.. What is a pure css3 carousel (no javascript)? How do you make a pure css3 carousel (no javascript)? This script and codes were developed by Hélio Marcondes on 09 November 2022, Wednesday.

Pure CSS3 Carousel (No Javascript) Previews

Pure CSS3 Carousel (No Javascript) - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Pure CSS3 Carousel (No Javascript)</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="carousel-wrapper"> <span id="item-1"></span> <span id="item-2"></span> <span id="item-3"></span> <div class="carousel-item item-1"> <h2>Item 1</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus accumsan pretium dolor vel convallis. Aliquam erat volutpat. Maecenas lacus nunc, imperdiet sed mi et, finibus suscipit mi.</p> <a class="arrow arrow-prev" href="#item-3"></a> <a class="arrow arrow-next" href="#item-2"></a> </div> <div class="carousel-item item-2"> <h2>Item 2</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus accumsan pretium dolor vel convallis. Aliquam erat volutpat.</p> <a class="arrow arrow-prev" href="#item-1"></a> <a class="arrow arrow-next" href="#item-3"></a> </div> <div class="carousel-item item-3"> <h2>Item 3</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus accumsan pretium dolor vel convallis. Aliquam erat volutpat.</p> <a class="arrow arrow-prev" href="#item-2"></a> <a class="arrow arrow-next" href="#item-1"></a> </div>
</div>
</body>
</html>

Pure CSS3 Carousel (No Javascript) - Script Codes CSS Codes

.carousel-wrapper{ height:400px; position:relative; width:800px; margin:0 auto;
}
.carousel-item{ position:absolute; top:0; bottom:0; left:0; right:0; padding:25px 50px; opacity:0; transition: all 0.5s ease-in-out;
}
.arrow{ position:absolute; top:0; display:block; width:50px; height:100%; -webkit-tap-highlight-color: rgba(0,0,0,0); background: url("http://dancort.es/assets/img/css-carousel/carousel-arrow-dark.png") 50% 50% / 20px no-repeat;
}
.arrow-prev{ left:0;
}
.arrow-next{ right:0; -webkit-transform: rotate(180deg); transform: rotate(180deg); }
.light{ color:white;
}
@media (max-width: 480px) { .arrow, .light .arrow { background-size: 10px; background-position: 10px 50%; } }
}
/*Select every element*/
[id^="item"] { display: none; }
.item-1 { z-index: 2; opacity: 1; background:url('https://static.pexels.com/photos/6526/sea-beach-holiday-vacation-large.jpg'); background-size:cover; }
.item-2{ background:url('https://static.pexels.com/photos/6506/alcohol-bar-drinks-party-large.jpg'); background-size:cover;
}
.item-3{ background:url('https://static.pexels.com/photos/6529/lake-kajak-kayak-large.jpg'); background-size:cover;
}
*:target ~ .item-1 { opacity: 0; }
#item-1:target ~ .item-1 { opacity: 1; }
#item-2:target ~ .item-2, #item-3:target ~ .item-3 { z-index: 3; opacity: 1; }
}
Pure CSS3 Carousel (No Javascript) - Script Codes
Pure CSS3 Carousel (No Javascript) - Script Codes
Home Page Home
Developer Hélio Marcondes
Username haykou
Uploaded November 09, 2022
Rating 3
Size 2,230 Kb
Views 54,648
Do you need developer help for Pure CSS3 Carousel (No Javascript)?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Hélio Marcondes (haykou) Script Codes
Create amazing marketing copy with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!