전환 효과를 사용하면 속성 값을 쉽게 변경할 수 있습니다. 기간을 설정할 수도 있습니다.
요소의 높이를 변경해 보겠습니다.
예
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 150px;
height: 150px;
background: blue;
transition: width 3s;
}
div:hover {
height: 200px;
}
</style>
</head>
<body>
<h1>Heading One</h1>
<p>Hover over the below box to change its height.</p>
<div></div>
</body>
</html>