top | item 46054982

(no title)

buovjaga | 3 months ago

Random grid gotcha that drove me crazy some time ago: due to browser bugs we can't use <img> elements with percentage widths or heights as grid items. The grid cell dimensions get blown out to the ones of the original image. Seen in both Firefox and Chromium. Relevant FF bug is probably https://bugzilla.mozilla.org/show_bug.cgi?id=1857365 '<img> grid item with percentage height, "width: auto", "grid-template-columns: auto", and no track stretching makes column to have the same width of the original image's width' (although someone there claims it works in Chromium).

discuss

order

bryanrasmussen|3 months ago

so if the img has a specific size set in width and height attributes or via css, and that size is not percentile or auto, the problem doesn't exist?

I'm just confused by the "original image's width".

chrisweekly|3 months ago

not OP but (unless silently edited) they wrote

> "<img> elements with percentage widths or heights"