4 ms·
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
by buovjaga 10mo 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 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).
- bryanrasmussen 10mo agoso 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 10mo agonot OP but (unless silently edited) they wrote > "<img> elements with percentage widths or heights"
- buovjaga 10mo agoThe Firefox bug report has an image that illustrates the issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1857365#c0 https://bugzilla.mozilla.org/show_bug.cgi?id=1857365#c0