Assessment help needed with HTML image task 1

Hello!
I am not able to come up with a solution for a particular question in Task 1, like I am not able to understand how to calculate the aspect ratio for an image.

The question:

  • Give the <img> element an appropriate width and height so that it displays at the correct aspect ratio, and enough space is left on the page to display it. The image’s intrinsic size is 615 x 419 pixels.*

Link to the original assessment

Any help would be appreciated!
Thank you!

@Aditya_Ramachandran Hope you are well,

Here’s what I’ve done in my exercise for this assessment which was assessed as correct by fellow members.

<img src="images/blueberries.jpg" width="615" height="419">.

That means you have to add both width and height attribute. whose value is 615 and 419 in order, which is the actual aspect ratio you wanted to understand.

Hope that helps.
Have a nice day.

@mikoMK what do you think I did it right or not?

@umarFaruq Thank you so much for your response
I did understand the solution!

hi all

Thanks @umarFaruq for helping out. :slightly_smiling_face:

Yes, that’s correct. When we set width and height to the same as the image itself, the aspect ratio is automatically right.

Cheers,
Michael

1 Like