Avatar of ShaneJones
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

Resizing a background-image in a div

I have a div that is 600 x 400px. I have a javascript tool that is a gallery it work by changing the background image of the div.

My image is bigger than the div tho, I dont want the div to resize I want the image to fit it without losing proportion. How can I set the background-image of the dive to be no larger that 375px in height.

The images in the div are of various sizes but as this is powered by a simple CMS the images can be of various sizes as the users may not upload small sizes.


Avatar of undefined
Last Comment

8/22/2022 - Mon