CSS Transform scale scrolling issue

前端 未结 1 1115
慢半拍i
慢半拍i 2020-12-20 12:40

I am creating a web app that uses CSS\' transform scale property. As shown by the image below, I have an object inside of a container, which fits nice and snugly inside, wit

相关标签:
1条回答
  • 2020-12-20 13:15

    My best guess would be that this is happening because of transform origin. Try setting it to 0 0 should fix Your issue:

    #object2 {
      position: relative;
      width: 120px;
      height: 120px;
      display: block;
      background-color: rgba(255, 0, 255, 0.45);
      border-radius: 25px;
      transform: scale(3);
      transform-origin: 0 0;
    }
    

    Demo codepen

    0 讨论(0)
提交回复
热议问题