I’m looking to have my images fully fill the CardMedia component. However, because they are of varying sizes, some end up being cropped like this:
https://i.stack.imgur.com/JHIrT.png
Additionally, when resizing the images, some get cut off as well:
https://i.stack.imgur.com/Bd9BU.png
This is the current code for the CardMedia section:
<Card
raised
sx={{
maxWidth: 280,
margin: "0 auto",
padding: "0.1em",
}}
>
<CardMedia
component="img"
height="250"
image={product.img_urls[0]}
alt={product.name}
title={product.name}
sx={{ padding: "1em 1em 0 1em" }}
/>
// Other Content
</Card>
Ultimately, I would like all cards to be uniform in size and shape like this example:
https://i.stack.imgur.com/eyDZk.png
Is there a way to resolve this issue or do I need to manually resize each image?