I am trying to apply styles for first and last elements which includes class .swiper-slide-visible
But I apply styles for all elements which do not include this class:
.swiper-slide-visible:first-child {
mask-image: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 100%);
-webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 100%);
}
.swiper-slide-visible:last-child {
mask-image: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 100%);
-webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 100%);
}
Styles are applied to 2nd element too.
.swiper-wrapper div.swiper-slide-visible:first-child apply styles to every div.swiper-slide
I have a right code for first element
.swiper-wrapper > div.swiper-slide-visible
.swiper-wrapper > div.swiper-slide-visible ~ div.swiper-slide-visible
But now I'm working on the last element. Need to find last element!