<amp-img> Horizontal Menu with Images of Equal Height and Different Width; please add layout with following properties: width:auto; height:100%; #22748
Labels
Component: amp-img
Customer: Developer
P3: When Possible
Type: DevX
issues impacting developer experience
Type: Feature Request
WG: components
Horizontal Menu with Images of Equal Height and Different Width
amp-img
Currently layout="responsive" actually does width:100%; height:auto;
I need a layout with width:auto; height:100%;
the size of a container is set already outside of an image
A work-around combining AMP's fill layout with the object-fit CSS property does not do its job at all!!!
I need the image to expand the parent element horizontally according to the set height.
object-fit and amp-img layout="fill" just shrink the image inside its parent container. I need to expand the width of the parent link element accordingly, to expand the width of the link element together with the image.
Right now object-fit and amp-img layout="fill" workaround just shrink the image inside a link container of a set height
I need a layout="newProperty" for a fixed height top menu, with images of different sizes for every link, the images expanding the width of the element; not the shrinking of the images according to the parent tag size
object-fit and amp-img layout="fill" is a garbage option, takes time and doesn't do what it is promised to do.
Please add a new layout to expand the parent element horizontally according to and with the calculated width of an image inside a parent element of a set height.
right now I'm successfully using a simple math formula for amp-img layout="responsive":
CSS:
#image1 {
width: calc ( ( originalWidthInPixels / originalHeightInPixels ) * requiredHeight ) ;
}
AMP-HTML:
<a>
<div id="image1">
<amp-img layout="responsive" width="originalWidthInPixels" height="originalHeightInPixels">
</amp-img>
</div>
<a>
The text was updated successfully, but these errors were encountered: