전환 타이밍 기능 사용 속성을 사용하여 전환 효과의 속도 곡선을 설정합니다. 설정할 수 있는 값은 ease, ease-in, ease-out, linear 등입니다.
다음 코드를 실행하여 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>