Cutting off bottom of image depending on background image container

I have a container with a background image. This container is a variable height, depending on the content inside it. As the container gets smaller, I would like to progressively cut off the bottom of the background image, while still keeping it in the same place.

I have played around with background-size and background-position but I haven’t been able to achieve this. Any advice?

Try using css background-position property.

https://www.w3schools.com/cssref/pr_background-position.asp