为什么取消ease-in-out就可以旋转,有这个值的时候就不行呢?
来源:3-3 编程练习
月华流照Jun
2018-10-24 16:19:04
div { font-size: 14px; font-weight: bold; line-height: 50px; position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 200px; height: 50px; margin: auto; cursor: pointer; text-align: center; background: #abcdef; /*此处写代码*/ transform:rotate(0deg) scale(1); } /*此处写代码*/ div:hover{ transform:rotate(180deg) scale(2); transition:transform,3s,ease-in-out; }
1回答
1、transition属性中各项之间是不需要逗号隔开的,直接空格就可以了。
2、元素需要旋转360度,在鼠标移出的时候,元素也是需要旋转回去的,而不是突然恢复原来的样式,可以在div样式中添加transition。
参考:
自己可以测试一下,祝学习愉快!
相似问题