【发布时间】:2022-01-04 21:26:50
【问题描述】:
所以最近我一直在尝试将 react 项目转换为 next 以及如何使用 next/Image 组件,这有点坏了
<div className=" flex flex-col items-center p-5 sm:justify-center sm:pt-9 sm:flex-row text-justify relative">
<div className="border-solid border-2 border-black rounded-full basis-[13%] sm:mr-10">
<Image
src={Me}
alt="Profile"
width={400}
height={400}
className="rounded-full"
objectFit="cover"
/>
</div>
<p className="text-sm sm:basis-2/4 m-4">
{/* {
Text goes here, this works fine, this isn't the problem its just part of the parent div :)
} */}
</p>
</div>;
由于某种原因,图像在边框之间有一个小填充
我查过了,没有边框,这只是nextjs的图片组件坏了。请全力帮助我已经尝试了这些解决方案,但这些都没有奏效: Next Image not taking class properties How to use Tailwind CSS with Next.js Image
谢谢 :)
【问题讨论】:
-
请提供更多代码(包含导入的整个 next.js 页面)。图片格式是什么?
标签: javascript reactjs next.js tailwind-css next-images