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

183
Views
How to scale a rotated child element to fit its parent?

I have this element with the following dimensions width: 90px height: 108px

Image 1

After rotating it's size "gets bigger"

Image 2

How can I scale it so it fits its container with any rotating angle?

Image 3

Code:

figure {
  grid-area: image;
  position: relative;
  transform: rotate(-12deg);
  width: min(50vw, 90px);
  height: min(60vw, 108px);
  img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 1.2rem;
    border: 6px solid var(--white);
  }
}

Ps: I'm using JSS, so any JavaScript solutions are also welcome.

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!