Can you create a carousel in a .container, but with visible overflow with plain CSS?

In swiper you can do this: https://codepen.io/Lko3001/pen/ByaqxZr So basically have some slides in side a container, but still have them overflow, is this possible to do with simple css?
Lko
CodePen
swiper test
...
7 Replies
Tok124 (CSS Nerd)
You cannot do swipe with just CSS, but you can use scroll-snap
lko
lkoOP4d ago
@Tok124 (CSS Nerd) I know you can't swipe, that's fine, the point is, can I replicate, in a scroll container, the overflow you see on the right? but still keeping them in the .container?
Tok124 (CSS Nerd)
Nah, you cannot make it exactly like that, the content that is overflowing will be hidden until you scroll to it
lko
lkoOP4d ago
Ok thanks, apparently there are people already discussing about it https://github.com/w3c/csswg-drafts/issues/7246
GitHub
[css-overflow] How does overflow-clip-margin: border-box behave on ...
Usually the border of the scrollable area is outside. What should happen on a scrollable box when you set overflow-clip-margin: border-box? Are you supposed to make the contents overlap the border ...
Jochem
Jochem4d ago
do please also remember https://shouldiuseacarousel.com/
lko
lkoOP4d ago
I have them too, but designers have the power
Jochem
Jochem4d ago
fair enough

Did you find this page helpful?