正在加载视频...

视频加载失败

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

59,733 次观看 • 1 年前 •via X (Twitter)

10 条评论

Alex Sidorenko 的头像
Alex Sidorenko1 年前

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

Armo 的头像
Armo1 年前

New syntax is fill="true"

Nick 的头像
Nick1 年前

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

Trade Assistant AI 的头像
Trade Assistant AI1 年前

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

kehinde.code 的头像
kehinde.code1 年前

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

Sam Selikoff 的头像
Sam Selikoff1 年前

he's back!!

niftesty 🫐 的头像
niftesty 🫐1 年前

Deprecated?

kötü biri değilim ama 的头像
kötü biri değilim ama1 年前

i hate next image

Joan Laporta 的头像
Joan Laporta1 年前

You don’t write width and height?

will 的头像
will1 年前

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

相关视频