Hi so I am trying to make a picture fit inside of my HTML-container. But I don’t quite know what command I should use to make it fit the conatainer’s size.
Also, I want to know if it is another way to(besides making it fit) dragging it around. So it keeps the same size as in the picture but dragg it down a bit so the top of the glass gets lower down inside of the container?
The problem with responsively resizing divs with background-images is that you can’t set a fixed height, you instead want to have a fixed aspect-ratio (like 4:3 for an image that is 400px wide and 300px high). I found this neat trick a while ago on w3schools: How To - Aspect Ratio / Height Equal to Width
How it works:
a container div with a padding-top:100% (for a square image) or padding-top:50% (for an image with aspect-ratio 2:1)
container is position:relative
within the container, a div that holds the background-image, set to position:absolute.