Skip to content
← Back to Community
Image object-fit not working properly!
Profile icon
SUHASTADIPARTH1

Image object-fit not working properly!

Hi, I am working on a django project, and I need some help with cropping and making an image fit inside it's div. If you are willing to help me, I can invite you to my project! And I will explain everything there. Thank you

Voters
Profile icon
SUHASTADIPARTH1
Comments
hotnewtop
Profile icon
MarkusVincenti

If you need to remove the blurring in the photo, I can recommend the softorbits service that I use for my freelancing. You can reduce the blur, and it will remove any blur and adjust the focus. It is beneficial for me.

Profile icon
SUHASTADIPARTH1

@MarkusVincenti Thank you, I'll try it out.

Profile icon
lsikora

Check this out.. <img src="{{image link}}" width="{{width}}" height="{{height}}"/>

Profile icon
SUHASTADIPARTH1

@CodeMaster007 Can I invited you to my repl, because I tried this and it didn't work!

Profile icon
lsikora
Profile icon
SUHASTADIPARTH1

@CodeMaster007 yes, can we do it Sun, Aug 15, 6:30 AM - EST timings?

Profile icon
lsikora

How about 9:30 EST? @SUHASTADIPARTH1

Profile icon
SUHASTADIPARTH1

@CodeMaster007 I'm sorry, I won't be at my laptop at that time! How about 7:30 AM Sunday? Right now, I'm about to retire for the night, so I won't come back till 5:30 AM in the morning! Thank you

Profile icon
lsikora

Sounds good to me! 7:30 @SUHASTADIPARTH1

Profile icon
SUHASTADIPARTH1

@CodeMaster007 Thank you, I'll invite you in about 1 and a half hour!

Profile icon
SUHASTADIPARTH1

@CodeMaster007 I invited you!

Profile icon
MrVoo

Just use max-width and max-height

Profile icon
SUHASTADIPARTH1

@MrVoo I tried that, it doesn't work. Can I invite you?

Profile icon
MrVoo

@SUHASTADIPARTH1 If you didn't fix it yet, you could try this:

#divId #imageId { max-width: 100%; max-height: 100%; }

If this doesnt work though I cant help :P

Profile icon
SUHASTADIPARTH1

@MrVoo Sorry, thanks for helping. It didn't work!

Profile icon
MrVoo

@SUHASTADIPARTH1 Which repl is it? There's a 10% chance I can stare at the code for too long and get a solution

Profile icon
SUHASTADIPARTH1

@MrVoo Ok, I will invite you!

Profile icon
SUHASTADIPARTH1

@MrVoo I invited you now!