Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

How to make the Next Image always fit the parent container while staying fully visible

59,743 görüntüleme • 2 yıl önce •via X (Twitter)

10 Yorum

Alex Sidorenko profil fotoğrafı
Alex Sidorenko2 yıl önce

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

Armo profil fotoğrafı
Armo2 yıl önce

New syntax is fill="true"

Nick profil fotoğrafı
Nick2 yıl önce

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

Trade Assistant AI profil fotoğrafı
Trade Assistant AI2 yıl önce

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

kehinde.code profil fotoğrafı
kehinde.code2 yıl önce

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

Sam Selikoff profil fotoğrafı
Sam Selikoff2 yıl önce

he's back!!

niftesty 🫐 profil fotoğrafı
niftesty 🫐2 yıl önce

Deprecated?

kötü biri değilim ama profil fotoğrafı
kötü biri değilim ama2 yıl önce

i hate next image

Joan Laporta profil fotoğrafı
Joan Laporta2 yıl önce

You don’t write width and height?

will profil fotoğrafı
will2 yıl önce

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

Benzer Videolar