【发布时间】:2021-08-29 16:11:17
【问题描述】:
在处理 SCSS 过渡时,我制作了两个类 trigger 和 box,当悬停在 trigger box 上时,应该开始移动和旋转。
.trigger {
display: inline-block;
width: 100px;
height: 100px;
max-width: 100px;
max-height: 100px;
background-color: #ddd;
outline: 20px solid #999;
position: relative;
margin: 25% 25%;
&:hover {
.box {
transform: translate(200px, 150px) rotate(20deg);
}
}
}
.box {
display: inline-block;
background-color: pink;
width: 100px;
height: 100px;
transition: transform 1000ms ease-in-out;
}
效果在 chrome 上运行良好 [1]:https://i.stack.imgur.com/E2CnC.png
然而 Firefox 会缩放触发边框 [2]:https://i.stack.imgur.com/6OVW4.png
玉码
.trigger
.box
【问题讨论】:
-
请注意,问题只能使用与问题相关的标签进行标记。出于这个原因,我删除了 Pug 标签。
标签: css sass css-animations