如何使用CSS设置过渡效果的速度曲线
使用 transition-timing-function属性设置过渡效果的速度曲线。您可以设置的值是:缓动,缓入,缓动,线性等。
示例
您可以尝试运行以下代码以使用CSS设置过渡效果的速度曲线-
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background: red;
transition: width 4s;
}
#effect1 {
transition-timing-function: linear;
}
#effect2 {
transition-timing-function: ease-in;
}
div:hover {
width: 250px;
}
</style>
</head>
<body>
<h1>Transition Effect</h1>
<p>Hover over the div elements and see the transition effect and the speed:</p>
<div id = "effect1">linear effect</div><br>
<div id = "effect2">ease-in effect</div><br>
</body>
</html>热门推荐
10 新年留言老师祝福语简短
11 过年祝福语南昌话简短
12 对别人新年祝福语简短
13 祝福语简短创意闺蜜
14 生日祝福语贺卡老师简短
15 英文写结婚祝福语简短
16 请灵回向祝福语简短
17 新婚祝福语简短十六字
18 祝贺新店开业祝福语简短