전환 효과가 있는 CSS 속성의 이름을 설정하려면 CSS transition-property를 사용하세요.
아래 예에서는 속성을 너비로 설정하고 기간도 설정했습니다.
예
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 150px;
height: 150px;
background: blue;
transition-property: width;
transition-duration: 3s;
}
div:hover {
width: 250px;
}
</style>
</head>
<body>
<h1>Heading One</h1>
<p>Hover over the below box to change its width.</p>
<div></div>
</body>
</html>