Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

260
Views
How to prevent a rotated resize: auto div from moving when resizing it?

This is a follow-up to my previous question.

Say we have the following code:

.rect {
  transform: rotateZ(45deg);
  width: 200px;
  height: 100px;
  resize: auto;
  overflow: hidden;
  background-color: #ddd;
}
<div class="rect"></div>

Notice how when you resize the element, the div seems to move as well. This is because it is rotated. If you remove the rotation amount, resizing works normally and you can make it wider and taller without the element seemingly moving.

I don't think transform-origin: top left is the solution, because my rectangle is indeed rotated around its center for the purposes of my application.

I'm unsure of whether a wrapper div will work. It seems like it has potential, but I'm unsure of how to handle the fact that there are now two separates widths and heights.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!