# image carousel

**URL:** <https://community.hubspot.com/t/image-carousel/99649>\
**Category:** CMS Development\
**Created:** [February 7, 2024, 10:52am UTC](https://community.hubspot.com/t/image-carousel/99649 "2024-02-07T10:52:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SBENALI9](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sbenali9/32/201071_2.png) [@SBENALI9](https://community.hubspot.com/u/SBENALI9)\
**Post date:** [February 7, 2024, 10:52am UTC](https://community.hubspot.com/t/image-carousel/99649/1 "2024-02-07T10:52:11Z")

</div>

i want to add a rich text over the images so when i hover the image the description appear. please anyone can help me do that  
this is my code :

\<!-- Add Slick CSS --\>

\<link rel=“stylesheet” type=“text/css” href=“[https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css](https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css)”/\>

\<link rel=“stylesheet” type=“text/css” href=“[https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css](https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css)”/\>

\<!-- Add jQuery (required by Slick) --\>

\<script src=“[https://code.jquery.com/jquery-3.6.0.min.js](https://code.jquery.com/jquery-3.6.0.min.js)”\>\</script\>

\<!-- Add Slick JavaScript --\>

\<script type=“text/javascript” src=“[https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js](https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js)”\>\</script\>

\<div class=‘visionaires-section’\>

\<div class=“slick-carousel”\>

{% for item in module.field\_group %}

{% if item.image\_field.src %}

{% set sizeAttrs = ‘width=“{{ item.image\_field.width }}” height=“{{ item.image\_field.height }}”’ %}

{% if item.image\_field.size\_type == ‘auto’ %}

{% set sizeAttrs = ‘width=“{{ item.image\_field.width }}” height=“{{ item.image\_field.height }}” style=“max-width: 100%; height: auto;”’ %}

{% elif item.image\_field.size\_type == ‘auto\_custom\_max’ %}

{% set sizeAttrs = ‘width=“{{ item.image\_field.max\_width }}” height=“{{ item.image\_field.max\_height }}” style=“max-width: 100%; height: auto;”’ %}

{% endif %}

{% set loadingAttr = item.image\_field.loading != ‘disabled’ ? ‘loading=“{{ item.image\_field.loading }}”’ : ‘’ %}

\<img src=“{{ item.image\_field.src }}” alt=“{{ item.image\_field.alt }}” {{ loadingAttr }} {{ sizeAttrs }}\>

{% endif %}

{% endfor %}

\</div\>

\</div\>  
css:

/\* Style for the carousel items \*/  
.slick-carousel {  
margin: 0 auto;  
width: 80%; /\* Adjusted width \*/  
}

.slick-carousel img {  
width: 80%; /\* Adjusted width \*/  
height: auto; /\* Adjusted height to auto \*/  
display: block;  
object-fit: cover;  
transition: transform 0.3s ease, filter 0.3s ease; /\* Add transition for smoother scaling and blur \*/  
}

/\* Scale the center image \*/  
.slick-center img {  
transform: scale(1.2); /\* Adjusted scaling \*/  
filter: blur(0); /\* Remove blur effect on center image \*/  
}

.slick-carousel img:not(.slick-center) {  
filter: blur(3px); /\* Apply blur effect to non-centered images \*/  
}

}  
js:  
$(document).ready(function(){  
var $carousel = $(‘.slick-carousel’);  
$carousel.on(‘init’, function(event, slick) {  
var $currentSlide = $(slick.$slides.get(slick.currentSlide));  
$currentSlide.addClass(‘centered’);  
});  
$carousel.slick({  
centerMode: true,  
centerPadding: ‘0px’,  
slidesToShow: 3,  
responsive: [  
{  
breakpoint: 768,  
settings: {  
arrows: false,  
centerMode: true,  
centerPadding: ‘0px’,  
slidesToShow: 1  
}  
},  
{  
breakpoint: 480,  
settings: {  
arrows: false,  
centerMode: true,  
centerPadding: ‘0px’,  
slidesToShow: 1  
}  
}  
]  
});  
$carousel.on(‘afterChange’, function(event, slick, currentSlide, nextSlide) {  
var $currentSlide = $(slick.$slides.get(currentSlide));  
$currentSlide.addClass(‘centered’);  
});  
$carousel.on(‘beforeChange’, function(event, slick, currentSlide, nextSlide) {  
var $currentSlide = $(slick.$slides.get(currentSlide));  
$currentSlide.removeClass(‘centered’);  
});  
});

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [February 7, 2024, 1:07pm UTC](https://community.hubspot.com/t/image-carousel/99649/2 "2024-02-07T13:07:40Z")

</div>

Hi @SBENALI9

So to achieve that you need to add a text field below your image. Position that text over an image and set its opacity to 0.

Now on .slick-carousel img:hover set the text opacity to 1 and you are good to go. You can also use transition property for a smooth animation. You can take a look at [this live example for more details.](https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_image_overlay_opacity)

I hope this will help you out. Please mark it as **Solution Accepted and upvote** to help another Community member.  
Thanks!
