css3缩放 transform: scale() 使用缩放之后顶点对齐问题

时间:2020-12-07 11:57:04   收藏:0   阅读:8

注意点:想要将缩放之后的div对齐顶点,那么需要将css属性设置为:transform-origin: 0 0

<div style="width: 900px; height: 900px; background: gray; overflow: auto;">
    <div style="width: 3000px; height: 3000px; background: indianred; margin: 20px; transform: scale(0.5); transform-origin: 0 0;">
    </div>
</div>

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!