Загрузка видео...

Не удалось загрузить видео

На главную

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

59,743 просмотров • 2 лет назад •via X (Twitter)

Комментарии: 10

Фото профиля Alex Sidorenko
Alex Sidorenko2 лет назад

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

Фото профиля Armo
Armo2 лет назад

New syntax is fill="true"

Фото профиля Nick
Nick2 лет назад

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

Фото профиля Trade Assistant AI
Trade Assistant AI2 лет назад

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

Фото профиля kehinde.code
kehinde.code2 лет назад

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

Фото профиля Sam Selikoff
Sam Selikoff2 лет назад

he's back!!

Фото профиля niftesty 🫐
niftesty 🫐2 лет назад

Deprecated?

Фото профиля kötü biri değilim ama
kötü biri değilim ama2 лет назад

i hate next image

Фото профиля Joan Laporta
Joan Laporta2 лет назад

You don’t write width and height?

Фото профиля will
will2 лет назад

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

Похожие видео