amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

amp-base-carousel – Images after the first slide don’t fill full width (leave margins on left/right)

Open prowessclust opened this issue 4 months ago • 8 comments

Description

I’m using in a responsive layout and noticed an issue:

Expected Behavior

  • Each image should fully fill the carousel width when it is active, the same as the first slide.

Actual behavior

  • The first image fills the width as expected.

  • From the second image onward, there is extra space (padding/margin) visible on the left and right, so the image doesn’t fully span the container.

  • The images are all the same dimensions and have layout="responsive", so this seems to be a carousel rendering/layout bug.

Reproduction Steps

Steps to reproduce:

  1. Go to https://playground.amp.dev/

  2. Copy Paste this code inside body tag

<amp-base-carousel loop="true" width="400" height="500" layout="responsive"> <amp-img src="https://images.unsplash.com/photo-1742201473141-07daabc7a327?q=80&w=1064&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" width="400" height="500" layout="responsive"></amp-img> <amp-img src="https://images.unsplash.com/photo-1750218537952-0ae056c7f53a?q=80&w=774&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" width="400" height="500" layout="responsive"></amp-img> <amp-img src="https://images.unsplash.com/photo-1755048796967-75a82d214846?q=80&w=985&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" width="400" height="500" layout="responsive"></amp-img> </amp-base-carousel>

nothing to worry, the code is huge because of the image link, it is just amp-base-carousel with three amp-img src If image does not open, try with different image link you can find online

Notice how on sliding to next image after first changes the dimension on left right side.

Image Image

Relevant Logs


Browser(s) Affected

Edge

OS(s) Affected

No response

Device(s) Affected

all devices show same behaviour

AMP Version Affected

No response

prowessclust avatar Aug 14 '25 05:08 prowessclust