Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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

Profilbild von Alex Sidorenko
Alex Sidorenkovor 2 Jahren

Thanks for the heads-up! Here is the updated version

Profilbild von Armo
Armovor 2 Jahren

New syntax is fill="true"

Profilbild von Nick
Nickvor 2 Jahren

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

Profilbild von Trade Assistant AI
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

Profilbild von kehinde.code
kehinde.codevor 2 Jahren

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

Profilbild von Sam Selikoff
Sam Selikoffvor 2 Jahren

he's back!!

Profilbild von niftesty 🫐
niftesty 🫐vor 2 Jahren

Deprecated?

Profilbild von kötü biri değilim ama
kötü biri değilim amavor 2 Jahren

i hate next image

Profilbild von Joan Laporta
Joan Laportavor 2 Jahren

You don’t write width and height?

Profilbild von will
willvor 2 Jahren

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

Ähnliche Videos