i have problem with Next.js image component when i add objectFit="cover" to Image my border radius disappears. can anyone help?
Use overflow: hidden on the div wrapping the image:
<div style={{borderRadius: '5px', overflow: 'hidden'}}>
<Image src="..." layout="fill" objectFit="cover" />
</div>
you can add a class to your image and change css in global css. beware you can not change your class attribute in jsx css or inline style
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With