Within a div, I have an element:
<div style="width:330px;"><iron-image src="image.png"></iron-image></div>
.
The image is 315px wide and 237px tall. I want the image to expand to 330px in width to fit its container without breaking the aspect ratio.
I attempted the following:
iron-image {
width:330px;
height:auto;
}
iron-image img {
width:330px;
height:auto;
}
Also tried this:
<div style="width:330px;"><iron-image src="image.png" style="width:330px;height:auto"></iron-image></div>
How can I ensure that the <img ... >
element within the <iron-image>
stretches to 330px in width with automatic height?