Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

265
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda