bobo2000
bobo2000

Reputation: 1877

javascript image cropping/resizing

Right,not sure what this is technically called or how to do this.

But how would you go about getting large images - landscape and portrait, and resizing them so that they fit the dimensions of a particular div without actually losing aspect ratio?

Upvotes: 0

Views: 61

Answers (1)

user1693593
user1693593

Reputation:

You can use this CSS entry to make the image scale and at the same time cover the entire element. Just note that you need to set the image as background image:

background-image:url(...);
background-size: cover;

Upvotes: 1

Related Questions