When I put img
s into a display: grid
parent and give them width: 100%
, they end up being their original size, instead of 100% of the allocated space in the grid.
Linux
width: 100%
on the images (this should make them as wide as the column they are in)The 100%
width on the images should refer to 100% of the grid cell that they make.
The images are at their original width instead of being the width of the cell.
https://psychpsyo.com/repro/ladybird/gridImageSize/
<style>
#cardGrid {
display: grid;
grid-template-columns: repeat(10, 1fr);
}
img {
width: 100%;
aspect-ratio: 813 / 1185;
}
</style>
<div id="cardGrid">
<img src="https://crossuniverse.net/images/cards/en/U00072.jpg">
<img src="https://crossuniverse.net/images/cards/en/U00075.jpg">
<img src="https://crossuniverse.net/images/cards/en/U00075.jpg">
<img src="https://crossuniverse.net/images/cards/en/U00075.jpg">
<img src="https://crossuniverse.net/images/cards/en/U00074.jpg">
<img src="https://crossuniverse.net/images/cards/en/U00074.jpg">
<img src="https://crossuniverse.net/images/cards/en/U00073.jpg">
<img src="https://crossuniverse.net/images/cards/en/U00073.jpg">
<img src="https://crossuniverse.net/images/cards/en/U00073.jpg">
<img src="https://crossuniverse.net/images/cards/en/U00045.jpg">
</div>
<!-- shortened from https://psychpsyo.com/repro/ladybird/gridImageSize/ , should still work though -->
None
None
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too