Replies: 6 comments 6 replies
-
Try first-child and last-child in css |
Beta Was this translation helpful? Give feedback.
-
Thanks for the tip - nothing "built in" that I've missed then I guess. We
have taken a slightly different direction on this now though by adding the
margin/padding within each individual slide (with bigger left padding for
the first instance, and bigger right padding for the last instance)
…On Tue, 25 Jan 2022 at 21:46, Ihor Sychevskyi ***@***.***> wrote:
Try first-child and last-child in css
—
Reply to this email directly, view it on GitHub
<#5388 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCKU3KBH4ED34R6TMLIYLUX4DYZANCNFSM5MZJTZ3A>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Guy Bowden
+33679309937
|
Beta Was this translation helpful? Give feedback.
-
I have used: |
Beta Was this translation helpful? Give feedback.
-
I found a solution!!! |
Beta Was this translation helpful? Give feedback.
-
you cannot use both at the same time |
Beta Was this translation helpful? Give feedback.
-
you can simply add paddings to the swiper div, .swiper {
padding: 0 20px !important;
} |
Beta Was this translation helpful? Give feedback.
-
I have a full-screen-width slider instance working well - however I'd like to add some spacing before the first slide and after the last slide such that there is an initial margin between the LHS of the screen (swiper container) but when I slide left, the slide goes to the full edge. Similarly on the RHS - I want my slides to come in from the screen edge, but stop with some margin - so the last slide is 20px in-board of the screen edge.
I've managed to get the LHS working by adding in a
wrapper-start
element of the required width. However thewrapper-end
element will only appear on the RHS of the last slide when "overscrolling" -wrapper-start
seems to push all my slides to the right by it's width - meaning the last slide is over-flowing the slider by the width of the start wrapper.I am currently using a
slidesPerView
of 1.x - each slide is a matching width, with the height resizing according to the no. of slides per view - so if I try to add padding to the first + last slides then they are rendered out a bit smaller than the rest.Any clues as to how I might achieve this?
^^ note margin on the left of the first slide, and right of the last slide.
Beta Was this translation helpful? Give feedback.
All reactions