troubleshooting Question

Resizing a background-image in a div

Avatar of ShaneJones
ShaneJonesFlag for United Kingdom of Great Britain and Northern Ireland asked on
CSSHTMLPHP
7 Comments1 Solution1400 ViewsLast Modified:
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.

Thanks
ASKER CERTIFIED SOLUTION
Panchux

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros