Friday, 14 June 2019

Max-height and max-width for divs with dynamic backgrounds?

I have a code responsible for cropping image and saving its cropped areas in a list of divs. Each of these divs represents each of the cropped images. But the problem is - I dont want them to be so huge, I want them to have fixed height and width, e.g. max 100x100px.

Codesandbox with working image cropping: https://codesandbox.io/s/fast-frost-0b5tt

You will see that image cropping works great, however newly created images have dynamic height and width.

Question: How to make these newly created divs to have fixed width and height, but without destroying it? Thanks!

Edit: New link added (the old one was missing styles)

The goal is to make the children (cropped images) to have static height and width, but keep the background image in correct position. But seems like im too stopid to do it by myself



from Max-height and max-width for divs with dynamic backgrounds?

No comments:

Post a Comment