tags:

views:

22

answers:

1

I have an image with width/height from the CSS file. I have now added a clip: property to the image, which changes based on the user defining the region.

What I want now is to:

  • Apply left and top properties so the image is in the right position
  • Have the width and height adjusted so that the visible clip region of the image is the same size as dictated in CSS.

Is there some obvious way to do this that I am missing?

Is it more complicated than I think?

A: 

One way to achieve this is to create a div which matches your height and width. Then add a nested div with the image as background. play with the margin/padding values (negative values included)

questzen