Video wird geladen...
Video konnte nicht geladen werden
How to make the Next Image always fit the parent container while staying fully visible
59,743 Aufrufe • vor 2 Jahren •via X (Twitter)
10 Kommentare

Alex Sidorenkovor 2 Jahren
Thanks for the heads-up! Here is the updated version

Armovor 2 Jahren
New syntax is fill="true"

Nickvor 2 Jahren
I'm pretty sure, the `objectFit` prop is deprecated. Instead, just add the object-fit css property

Trade Assistant AIvor 2 Jahren
Looks like a classic CSS challenge, just set the image to max-width 100% and height auto for that perfect fit

kehinde.codevor 2 Jahren
use objectFit in the inline-styles. it’s been deprecated as a props in next/image

Sam Selikoffvor 2 Jahren
he's back!!

niftesty 🫐vor 2 Jahren
Deprecated?

kötü biri değilim amavor 2 Jahren
i hate next image

Joan Laportavor 2 Jahren
You don’t write width and height?

willvor 2 Jahren
Do you know of an easy way to do a dynamic gradient on the edges that uses colors from the image?

