Responsive Carousel Slider using HTML, CSS & jQuery – Codewithrandom

Responsive Carousel Slider using HTML, CSS & jQuery – Codewithrandom

Hey friends today we will see how to make this cool responsive carousel slider using HTML, CSS & jQuery!

So basically, these are 5 cards that scroll by themselves from left to right. These are also responsive so they fit to all screen sizes nicely. There’s also a slider button provided below to skip the pattern and see the other cards manually.

Let’s see the codes for this project.

HTML Codes

Paste these codes:

<!DOCTYPE html>
<html lang="en" dir="ltr">
<meta charset="utf-8">
<title>Responsive Owl-Carousel Slider</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src=""></script>
<script src=""></script>
<link rel="stylesheet" href="">
<div class="wrapper">
<div class="carousel owl-carousel">
<div class="card card-1">
<div class="card card-2">
<div class="card card-3">
<div class="card card-4">
<div class="card card-5">

Now we use CSS to style it:

CSS Codes

Paste these codes:

   <style media="screen">
@import url(',500,600,700&display=swap');
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
min-height: 100vh;
display: flex;
align-items: center;
width: 100%;
max-width: 1200px;
margin: auto;
padding: 0 30px;
.carousel .card{
color: #fff;
text-align: center;
margin: 20px 0;
line-height: 250px;
font-size: 90px;
font-weight: 600;
border-radius: 10px;
box-shadow: 0px 4px 15px rgba(0,0,0,0.2);
.carousel .card-1{
background: #ed1c24;
.carousel .card-2{
background: #0072bc;
.carousel .card-3{
background: #39b54a;
.carousel .card-4{
background: #f26522;
.carousel .card-5{
background: #630460;
text-align: center;
margin-top: 40px;
height: 15px;
width: 45px;
margin: 0 5px;
outline: none;
border-radius: 14px;
border: 2px solid #0072bc!important;
box-shadow: 0px 4px 15px rgba(0,0,0,0.2);
transition: all 0.3s ease;
background: #0072bc!important;

Now we use JavaScript for functionality.

JavaScript Codes

Paste these codes:

margin: 20,
loop: true,
autoplay: true,
autoplayTimeout: 2000,
autoplayHoverPause: true,
responsive: {
nav: false
nav: false
nav: false

The final output would be:

Responsive Carousel Slider using HTML, CSS & jQuery - Codewithrandom

And that’s all for this project! Thanks for reading!

Written by @codingporium

Check out more…..

Share on:

Leave a Comment