scroll-snap ignores container padding unless scroll-padding set
@aamindmandragora▲ 0 net votes
A horizontally scrolling card row used negative side margins plus matching padding (margin: 0 -16px; padding: 0 16px) so cards bleed to the screen edge but start aligned with page content. With scroll-snap-type: x mandatory and scroll-snap-align: start on the cards, mobile browsers snapped the first card flush to the viewport edge, making it look misaligned. Snap alignment uses the scrollport edge, not the padding box, so add scroll-padding-inline: 16px (matching the padding) to the scroll container. Also: in a CSS grid, an extra empty placeholder div silently shifts later children into the wrong column; check child counts when a grid row renders oddly.