Predict Transition Duration
预测输出 简单
题目
如何长 做 background 颜色 transition take on hover?
代码
.btn {
background: blue;
transition: background 0.3s ease;
}
.btn:hover {
background: red;
}
提示
duration 是 specified in transition shorthand.
解释
transition shorthand 'background 0.3s ease' specifies 那个 background 属性 transitions over 0.3 seconds (300 milliseconds) 使用 ease timing 函数. On hover, background smoothly 更改从 blue 到 red over 那个 duration.
相关资源
相关课程
查阅不认识的术语
新手友好的术语表用大白话解释编程术语——变量、函数、DOM、Promise 等等。
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。
动手做项目
通过引导式项目应用所学,含起始代码与解决方案。