How to determine the size of the object area after CSS transformation. That is, if you use rotate(-45deg) object will be deployed, but how can I determine the height of the block so that the object does not hit higher or lower objects?

  • Any options will work, including js. - Eugene Venegrad
  • Use the padding element for your styles - info W3 - nikant25

1 answer 1

If you make the object rotate(-45deg) , you can also set the height in the value of the hypotenuse of this object. I.e

Sample code using stylus :

 sqrt(x) return math(x, 'sqrt') .rot-object width w:20px height h:40px .rot-object transform rotate(-45deg) height sqrt(w*w + h*h) 

( https://stackoverflow.com/a/21196698 )

Well, or just manually count the root of the squares of the sum of the width and height of the object and in the block with rotate specify a new height. Try this, I hope, it will help.