Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swiper.js slide width

There was a big problem with Swiper.js
Is it possible to somehow make the width of the slides equal to the width of the content again?
At the moment, all slides stretch to the full width of the parent, most likely because I set the container grid element
I have been trying to solve the problem for a very long time, but I just can’t tell me I will be grateful!!!
(screenshot attached)

like image 578
SineYlo Avatar asked Nov 20 '25 05:11

SineYlo


1 Answers

slidesPerView: 'auto'

and in CSS: (On the swiper-slide component itself.)

.swiper-slide{
 width: fit-content;
}
like image 95
Bohdan Marchenko Avatar answered Nov 21 '25 18:11

Bohdan Marchenko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!