Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

268
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda