【发布时间】:2015-11-09 02:33:15
【问题描述】:
这就是我想要缩放图像的方式,smoothly without any jumps。
我的尝试不像上面的画廊那样工作,图像(在我的例子中是红色方块)跳跃,my code:
section {
background-color: rgba(0, 0, 0, 0.701961);
width: 400px;
height: 400px;
}
div {
position: absolute;
top: 120px;
left: 120px;
width: 160px;
height: 160px;
background-color: red;
-webkit-transition: all .2s ease-in-out;
}
div:hover {
-webkit-transform: scale(1.8);
}
<section>
<div></div>
</section>
如何解决这个问题?红色方块跳跃。是否可以像开头链接中的图库那样使用 CSS 过渡平滑缩放?
【问题讨论】:
标签: html css css-transitions image-scaling