【发布时间】:2019-04-16 20:15:38
【问题描述】:
我在 CSS 中的转换有问题。
#test{
height:100px;
width: 100px;
background-color: red;
margin-left: 100px;
margin-top: 100px;
}
#test:hover{
transform : scale(2);
transition:1s ease-in-out;
transform-origin : left top;
}
问题是,当您将鼠标悬停在 div 上时,它会略微向上浮动,而我想要做的是坚持一个地方,并且仅在右侧和底部增长/重新缩放。
希望你们明白我想说的话。
【问题讨论】:
-
检查您需要的转换原点 -- w3schools.com/cssref/css3_pr_transform-origin.asp
-
问题是,当我擦除过渡时没有问题..
-
ease-in-out - 指定一个缓慢开始和结束的过渡效果 - 这就是你想要的吗? -- w3schools.com/css/css3_transitions.asp
标签: css css-transitions scale css-transforms