CSS3 Transform Scale and Container with Overflow

大兔子大兔子 提交于 2019-12-03 16:32:42

The image is scaled from center radially outwards, thus causing the top-left image pixels to disappear. Check this working fiddle http://jsfiddle.net/RhmxV/37/

.scale_x2 {
    margin-left: 150px;
    margin-top: -193px;
    -webkit-transform: scale(2);
    -moz-transform: scale(2);
    -ms-transform: scale(2);
    -o-transform: scale(2);
    transform: scale(2);
}
.scale_x4 {
    margin-left: 450px;
    margin-top: 15px;
    -webkit-transform: scale(4);
    -moz-transform: scale(4);
    -ms-transform: scale(4);
    -o-transform: scale(4);
    transform: scale(4);
}

If you want to keep the top left corner where it is, use transform-origin:

transform: scale(2);
transform-origin: top left;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!