Centering items in Slick carousel

Here is the CodePen link:

I want the items of the Slick carousel to be centered while responsive. Right now, if you lower the width of the browser, the items will be located justified to the left.

This person had the exact same problem:

I tried both solutions, and no luck.

The first solution didn’t do anything for me:

.slick-track {

Centering the images works, but it messes up the positioning of the paragraphs (img-slide-text).

How can I resolve this issue? Any help would be greatly appreciated. Thanks! :slight_smile:

Try something like this:

.slick-slide img{margin:auto;left:auto;}
p.img-slide-text{margin:2rem auto 0;}
1 Like