Ask coding questions

← Back to all posts
Image object-fit not working properly!
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
SUHASTADIPARTH1
Comments
hotnewtop
CodeMaster007

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

SUHASTADIPARTH1

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

CodeMaster007
SUHASTADIPARTH1

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

CodeMaster007

How about 9:30 EST? @SUHASTADIPARTH1

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

CodeMaster007

Sounds good to me! 7:30 @SUHASTADIPARTH1

SUHASTADIPARTH1

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

SUHASTADIPARTH1

@CodeMaster007 I invited you!

MrVoo

Just use max-width and max-height

SUHASTADIPARTH1

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

MrVoo

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

If this doesnt work though I cant help :P

SUHASTADIPARTH1

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

MrVoo

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

SUHASTADIPARTH1

@MrVoo Ok, I will invite you!

SUHASTADIPARTH1

@MrVoo I invited you now!