I am trying to have a page with vertical scrolling snapped to every paragraph (every photo description). I also want body
to be my scrolling container, not some div
inside body
.
I have:
body.scroll-snap {
scroll-snap-type: y proximity;
}
.scroll-snap .episode p {
scroll-snap-align: start;
scroll-margin: 8px;
}
This works perfectly in Chrome and Safari, but doesn't work in Firefox. Firefox inspector shows these CSS properties applied to tag, but the scroll doesn't snap.
How to make it work in FF without creating additional scrolling containers?
scroll-snap-align: start
and end up with items not snapping correctly to the top of the screen. I believe what happened is they forgot to account for the URL bar when calculating the final scroll position. It will work fine most of the time, but can fail if you scroll up and down several times (even withmandatory
). I'm looking into filing a bug on this behavior. – Pry