@PoojaHiwade .,
Always include width and height size attributes on your images and video elements. Alternatively, reserve the required space with CSS aspect ratio boxes. This approach ensures that the browser can allocate the correct amount of space in the document while the image is loading.
You may notice the width and height above do not include units. These “pixel” dimensions would ensure a 640x360 area would be reserved. The image would stretch to fit this space, regardless of whether the true dimensions matched or not.
When Responsive Web Design was introduced, developers began to omit width and height and started using CSS to resize images instead:
img {
width: 100%; /* or max-width: 100%; */
height: auto;
}
Shopify Image Element Explicit width and height: