0

I have a 100px*100px div with a square image as child. This image has a scale of 1.5, so the size is 150px*150px.

Now if I apply on the image a translation of 25px (X or Y), should I not have the image at the edge of its parent?

Currently I need to translate of 16px to get to the edge, that's make no sense to me. What is the calcul here?

I'm pretty sure I missing the obvious here, but I'm having a hard time to figure it out.

.parent {
  width: 100px;
  height: 100px;
  border: 1px solid red;
  margin: 0 auto
}

img {
  width: 100%;
  height: auto;
  transform: scale(1.5) translateY(-25px);
  z-index: -1;
  position: relative;
}

https://codepen.io/geosenna/pen/pYNyjR

user3415011
  • 195
  • 1
  • 2
  • 11

0 Answers0