How to make image start from top of the div and add border radius?
https://codepen.io/avinash-tallapaneni/pen/dygGrjR
parent div of image is positioned
display:absolute to its parent. so setting display:relative to the parent wont work. How should i proceed? Also since im using object-fit:contain how should i add border-radius to the image?
5 Replies
Can you clarify what you're trying to achieve?
each image is of different size, so im trying to make it fit to the top of the respective parentdiv
Then you need object-fit: cover rather than contain.
And then put overflow: hidden on the parent to round the image too
if i do
object-fit:cover the visible part of the image is very little and the user cant see the image.Use smaller images